sdasda7777 / ScheduleBlock

Browser extension that allows you to block any set of websites based on a schedule.
GNU General Public License v3.0
13 stars 1 forks source link

Web page not closing when option is selected #3

Open kolcs opened 11 months ago

kolcs commented 11 months ago

I would like to block notifications about adblockplus updates. I made the following settings: image

However when I open the following page: https://new.adblockplus.org/en/update?an=adblockpluschrome&ap=chrome&apv=120.0.0.0&av=3.21.1&p=chromium&pv=120.0.0.0

the tab keeps opened. I also tested it with facebook.com.

sdasda7777 commented 11 months ago

Thanks, I think the issue might be the site is blocking scripts that don't have the same origin. Although you are able to enter the code, I cannot guarantee the browser will be able to execute it, iirc.

You might see reports about script origin violation in the developer console, I think.

sdasda7777 commented 11 months ago

Oh, no, sorry for the mystification, the script execution probably has nothing to do with that. Are you sure that the regex matches the URL? You can copy the URL of the given page and test it in the tester on the settings page.

kolcs commented 11 months ago

Yes, I tested, with the regex checker and it was OK. Your first suggestion give me a hint, therefore I found a solution: I redirect the page to an other one and close it.

window.location = 'https://to/other/site';
window.close();
kolcs commented 11 months ago

Strange... It worked only once... Since then it only redirects me to any custom page I define but does not close the window...

sdasda7777 commented 11 months ago

Yes, I tested, with the regex checker and it was OK.

Yeah, you're right, it matches for me as well. However, for me it seems to work as expected, the window gets closed. Would you mind telling me what your browser, browser version and extension version are? 🤔

Since then it only redirects me to any custom page I define but does not close the window...

That's actually the behaviour I would expect, yeah. I believe execution of scripts should be terminated when the page changes, to prevent malicious code stealing your cookies or whatever.

kolcs commented 11 months ago

Google Chrome Version 120.0.6099.109 (Official Build) (64-bit)

sdasda7777 commented 11 months ago

And what is the version of ScheduleBlock you are using?

kolcs commented 11 months ago

found it: 1.1.6

sdasda7777 commented 11 months ago

Hmm, I'm not sure what the issue might be, this exact setup seems to be working on my machine. Are you using any extension that might be interfering? Could you try disabling all the other extensions? Also, could you show me the other rules you are using in case that is the issue?

kolcs commented 11 months ago

Settings: image

Disabled extensions: image

sdasda7777 commented 11 months ago

I don't find anything suspicious about the rules. I take it it doesn't work even with the other extensions disabled? Also, could you try Facebook instead of new.adblockplus.org again?

kolcs commented 11 months ago

same...

sdasda7777 commented 11 months ago

Anything of interest in the developer console? Unfortunately I can't do anything about this unless I can replicate it 😕

kolcs commented 11 months ago

I understand. I will try later on another computer...

sdasda7777 commented 11 months ago

@kolcs Hi, did you manage to replicate it on a different machine?

sdasda7777 commented 10 months ago

@kolcs Hi, do you have any new information for me to look into? (I will eventually close this issue unless that is the case)

kolcs commented 10 months ago

Sorry for the late answer. I tested it on different computers with my google profile. Then I even signed out and tested it with an empty profile and checked the console output: image

It is the same regardless I am logged in to my profile or not.

sdasda7777 commented 8 months ago

Hi, sorry for no reply. Does this happen to you every time you open the page? Does it happen regardless of how you open the page? I actually found one way to replicate this exact warning message, but it's not something I would personally stumble upon accidentally 😅

sdasda7777 commented 8 months ago

From what I gather, the gist seems to be that for security reasons Chrome (and Firefox as well) doesn't allow closing of windows by scripts, unless in specific circumstances. For whatever reason for you the circumstances are never met, but it generally affects all users, as I said above. Unfortunately this is completely out of the extension's control, and achieving this functionality would mean circumventing Chrome's security, and then again every time the given vulnerability is fixed. Currently it seems I can only recommend using one of the other actions instead of closing the window, and perhaps chiming in on this request for change: https://issues.chromium.org/issues/40744259