A vigorous, no pop up pages feature!

In uBlock Origin, it is possible to toggle all pop-up pages from a site of your choice ( This stops those click a link/video/captcha etc prventing them from opening up other windows taking you to popupads.net for example or to find a horny single lady in your area.)

If there's a way to implement that into Adguard? It would be awesome, that would prevent sneaky ads from popping up for sure!
 

ag_bug_finder

Beta Tester
I agree.
I'd love to see such a feature.
It would certainly make my life easier than reporting a million pop-up windows issues....
 

worldsdream

Beta Tester
If I am correct, you can add the website and
%#window.btoa = function() { }; behind it to userfilter.

Example: test.com%#window.btoa = function() { };
 

Blaz

Moderator & Translator
Staff member
Moderator
That only works for sites which use btoa function.
 

avatar

Administrator
Staff member
Administrator
That's possible.

Here is a simple script preventing new windows on a given website:
Code:
(function() {
    // Prevent links from opening anything in a new window
    document.addEventListener('click', function(e) {
        if (e.target.localName === 'a' && 
            e.target.getAttribute('target') &&
            e.target.getAttribute('target') != "_self") {
            return false;
        };
    });

    // Prevent scripts from using window.open
    window.open = function() {};
})();
In form of a rule:
Code:
example.org#%#(function(){document.addEventListener("click",function(a){if("a"===a.target.localName&&a.target.getAttribute("target")&&"_self"!=a.target.getAttribute("target"))return!1});window.open=function(){}})();
It can be further improved, but I'd need actual examples of the websites, where it could be useful.
 

Blaz

Moderator & Translator
Staff member
Moderator
Please note this rule should not be used as generic as it can break features of a site.
 
Top