possible window.open conflict with popup blocker add-on

Everything about using Adblock Plus on Google Chrome
Post Reply
jeremy_schomery
Posts: 1
Joined: Tue Nov 22, 2016 1:15 pm

possible window.open conflict with popup blocker add-on

Post by jeremy_schomery »

I am working on a popup blocker extension for Chrome browser. To block all popups, the extension overwrites the unprotected window.open on document_start using:

Code: Select all

Object.defineProperty(window, 'open', {
    writable: false,
    configurable: false,
    value: function () {

    }
);
When AdBlock Plus is installed, web pages can bypass the popup blocker although the

Code: Select all

window.open
is still overwritten.
Example: First click on

Code: Select all

http://vidtodo.com/03pbhekfsihm
when browser window is cleared.

Any idea how to prevent this?
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: possible window.open conflict with popup blocker add-on

Post by lewisje »

As Raymond Hill's commit in response to this Issue suggests, the problem appears to be that site's use of WebRTC; anyway, I already described there how a particularly crafty site could detect that window.open was tampered with, and grab a new copy of the real thing: https://github.com/gorhill/uBlock/issues/2172
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Post Reply