Uassets: nwtehranmusic.com [popup]

Created on 3 Jul 2018  路  5Comments  路  Source: uBlockOrigin/uAssets

URL(s) where the issue occurs

First load this address: nwtehranmusic.com, then open another link on website, e.g.: http://www.nwtehranmusic.com/1943831/ahmad-saeedi-dele-divooneh/

Describe the issue

A popup opens with following address: https://telegram.me/tehranmuzic when you click somewhere on new loaded page.

Versions

  • Browser/version: Chrome Version 67.0.3396.99 (Official Build) (64-bit)
  • uBlock Origin version: v1.16.12

Settings

  • using this list: http://mynext.pro/BLF.txt which has the following rule. because this website (nwtehranmusic.com) was previously loading a popup script through external (non-inline) script.
    nwtehranmusic.com##script:inject(abort-on-property-read.js, InitPop)

Notes

I tried with following filters, but none of them worked except the first one. I think blocking all inline scripts could be the last option to go with, so I thought maybe you can fix it in an appropriate way.

||nwtehranmusic.com*$inline-script
nwtehranmusic.com##script:inject(set-constant.js, needpop, 0)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, readCookie)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, InitPop)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, vc_url)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, LoadStandardPop, pLoaded)

All 5 comments

@mapx- it is happening again and the followings cannot block it. Could you please have a look at it again?

nwtehranmusic.com##script:inject(abort-on-property-read.js, vc_url)
nwtehranmusic.com##script:inject(abort-on-property-read.js, vc_cn)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, readCookie)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, LoadStandardPop)

I tried with other combinations as well, but it didn't work. I'm really into knowing what is preventing uBO not to work on that inline script. Or how to have a proper view on fixing this issue (do you follow somewhere in DevTools, where?) I'm just looking at the page script and choose a combination of uBO scriptlets until it gets fixed, and this trial/error method was mostly working for me until this case that seems to have a simple script came up.

Procedure to reproduce the issue:

  1. Open nwtehranmusic.com
  2. Open a link, e.g http://www.nwtehranmusic.com/1943922/ashvan-moghaser/
  3. Click on any part of the page and pop up opens.

Chrome 67.0.3396.99
uBO v1.16.12

a copy of inline script of the page:

var needpop = 1;
var vc_cn = "jot9843504";
var vc_url = "https://telegram.me/tehranmuzic";
if (readCookie(vc_cn)) {
    needpop = 0;
} else {
    needpop = 1;
}
var PopWidth = 468;
var PopHeight = 468;
var PopTargetingMethod = 100;
var PopUseDivLayer = 1;
var RTSDomain = vc_url;
var debugDomain = vc_url;
var Page_Popped = false;
var Page2_Popped = false;
var Page_Loaded = false;
var Page_Enter;
var MySiteDomain = window.location.href.split('/');
if (needpop == 1) {
    InitPop()
}

function InitPop() {
    Page_Enter = new Date();
    if (window.captureEvents) {
        window.captureEvents(Event.CLICK);
        window.onclick = LoadStandardPop
    } else document.onclick = LoadStandardPop
}

function SiteEnter() {
    Page_Loaded = true
}

function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (2 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString()
    } else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name) {
    var ca = document.cookie.split(';');
    var nameEQ = name + "=";
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length)
    }
    return null
}

function RetrieveCount() {
    var cookieName = vc_cn;
    var popSuccesses = readCookie(cookieName);
    if (popSuccesses != null) popSuccesses = parseInt(popSuccesses);
    else popSuccesses = 0;
    return popSuccesses
}

function IncrementCount() {
    var cookieName = vc_cn;
    var popSuccesses = readCookie(cookieName);
    if (popSuccesses != null) createCookie(cookieName, parseInt(popSuccesses) + 1, 1);
    else createCookie(cookieName, 1, 1)
}

function LoadStandardPop() {
    if (Page_Popped == true) return;
    var pLoaded = false;
    if (window.SymRealWinOpen) {
        open = SymRealWinOpen
    }
    if (window.NS_ActualOpen) {
        open = NS_ActualOpen
    }
    var pxLeft = 0;
    var pxTop = 0;
    if (screen.width > 0 && screen.height > 0) {
        pxLeft = (screen.width / 2) - (PopWidth / 2);
        pxTop = (screen.height / 2) - (PopHeight / 2) - 50;
        if (pxLeft < 0) pxLeft = 0;
        if (pxTop < 0) pxTop = 0
    }
    pLoaded = open(vc_url, '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,men ubar=1,resizable=1,top=' + pxTop + ',left=' + pxLeft + ',width=' + PopWidth + ',height=' + PopHeight);
    if (pLoaded) {
        Page_Popped = true;
        IncrementCount()
    } else {
        Page_Popped = true;
        if (Page_Loaded) initAdLayer();
        else XBrowserAddHandlerPops(window, "load", "initAdLayer")
    }
    window.focus()
}

test this filter
nwtehranmusic.com##script:inject(abort-on-property-write.js, open)

Yes, this is working. Thanks. Could you please elaborate how did you end up with this filter?
Is it related to this part > pLoaded = open(vc_url, '', 'toolbar=1,scrollbars=1,... in function LoadStandardPop()?
If so, is there any answer why blocking whole LoadStandardPop through following filters doesn't work?

nwtehranmusic.com##script:inject(abort-current-inline-script.js, LoadStandardPop)
nwtehranmusic.com##script:inject(abort-on-property-read.js, LoadStandardPop, pLoaded)

or using followings?

nwtehranmusic.com##script:inject(abort-on-property-read.js, vc_url)
nwtehranmusic.com##script:inject(abort-current-inline-script.js, InitPop) ::: supposed to prevent running InitPop() which calls LoadStandardPop() to open a popup window

I tested first in firefox, no issue there for me, so could be a race condition in chrome ?!

Yes, my filter is related to open(vc_url,...

@nimasaj just fyi nwtehranmusic.com##script:inject(abort-on-property-read.js, SymRealWinOpen) should also work or nwtehranmusic.com##script:inject(set-constant.js, SymRealWinOpen, noopFunc).

mapx- filter works, so no need to change it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

patrickdrd picture patrickdrd  路  4Comments

melnation-com picture melnation-com  路  4Comments

wis picture wis  路  4Comments

ghost picture ghost  路  3Comments