-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling ublocklite doesn't fully disable it #20
Comments
You need to provide more information if you want me to reproduce on my side, I can't investigate what I can't reproduce. Tell me everything I need to do in details for me to reproduce -- keep in mind I am not behind you looking at your monitor. |
What's your default filtering mode in uBO Lite? |
The problem does not occur when default mode is set to Basic. Unfortunately, I do not know how this can be fixed, as there is no way to tell the scripting API to declaratively exclude script injection according to the root context. Another limitation is that with the permissions API there is no way to exclude a specific site from an extension. For now the only workaround I see is to work in Basic mode by default, and enable higher blocking modes only for specific sites. The CSS style being injected in the Google Ad frame: I might open an issue with MV3 people to make them aware of this sort of issues. |
I see, thanks for the reply |
This issue is affecting other extensions from being used on specific sites for me and my team. We use Hubspot for our sales emails to track and log them in our CRM. Their Hubspot Sales Extension allows us to do this within the Gmail interface. Unfortunately, uBOL does not completely "turn off" when I select 'no filtering' on mail.google.com. The Hubspot extension fails every time uBOL is installed. It works when uBOL is uninstalled. uBOL is our companies only allowed adblocker. I've worked with Hubspot support team and have exhausted all options to work around uBOL. They provided a list of their domains that I added to uBOL's "allow" list, but no change to the failing functionality. Any suggestions? Let me know if you need any more info, screenshots, or anything else. We would really appreciate your help in solving this issue. |
This can only be solved by the browser API providing new functionality to the scripting.registerContentScripts equivalent to DNR's |
Following the discussion at w3c/webextensions#668, I did try the suggestion to use a synchronous XHR-based hacky solution, and I have a prototype which solves the issue. It works this way: Create a dynamic DNR rule as follow {
id: ALLOWALL_HACK,
action: {
type: 'redirect',
redirect: {
extensionPath: '/web_accessible_resources/filtering-enabled'
},
},
condition: {
resourceTypes: [ 'xmlhttprequest' ],
urlFilter: '|https://ubol.invalid/filtering/',
},
priority: 100,
}
Content script side, there is this code: // https://github.com/uBlockOrigin/uBOL-home/issues/20
// https://github.com/w3c/webextensions/issues/668
// Hacky, until a better solution is possible in MV3.
// If the xhr fails, this means the request was not redirected to a local
// resource by the extension, which indicates that no-filtering mode is in
// effect for the root context.
{
const ancestors = document.location.ancestorOrigins;
if ( ancestors && ancestors.length !== 0 ) {
const rootOrigin = ancestors.item(ancestors.length-1);
if ( rootOrigin !== document.location.origin ) {
const xhr = new XMLHttpRequest();
try {
xhr.open('GET', `https://ubol.invalid/filtering/`, false);
xhr.send();
} catch(ex) {
return; // no filtering should occur
}
}
}
} So when disabling filtering for However this comes at the cost of undesirable side effects:
With sites for which uBOL is disabled, the console may be polluted by numerous error messages because |
Hmm... That sounds like a trivial way for websites' anti-adblock? |
Yes, hence why it's unlikely I go ahead with this fix, it was just a proof of concept that this can be done, but there is a cost. The real solution would be for uBOL to be able to dynamically register data to be injected in isolated and main world and accessible to registered scripts. |
Another approach is to use |
I am trying to disable ublock completely on some website so I see ads, an example of a website I need the ad block to fully ignore is
tab.gladly.io
(tab for a cause) , the issue when I fully disable the filters (the extension clearly says no filters and after reloading) it still wouldn't show ads at all .The text was updated successfully, but these errors were encountered: