Page 1 of 1

possible window.open conflict with popup blocker add-on

Posted: Tue Nov 22, 2016 1:19 pm
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?

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

Posted: Tue Nov 22, 2016 6:35 pm
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