Skip to content
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

ublockorigin cannot filter the tracking params in url in some particular case (filter function -> $removeparam) #1951

Closed
6 tasks done
cxw620 opened this issue Jan 26, 2022 · 8 comments
Labels
duplicate This issue or pull request already exists

Comments

@cxw620
Copy link

cxw620 commented Jan 26, 2022

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

URL(s) where the issue occurs

baidu.com

Describe the issue

As shown in the issue title.

ublockorigin cannot filter the tracking params in url in some particular case. (filter function -> $removeparam)

It is hard to describe in English for I am Chinese, so I describe the issue in details with some screenshots. Please refer to them.

Screenshot(s)

image
image
image

Notes

In my opinion, that ublockorigin my not filter tracking params in URL twice until a new tab is created causes such issue.

Reasons and examples were also described in screenshots.

Configuration

{
  "timeStamp": 1643201137402,
  "version": "1.40.8",
  "userSettings": {
    "advancedUserEnabled": true,
    "cloudStorageEnabled": true,
    "externalLists": "https://anti-ad.net/adguard.txt\nhttps://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuard.txt\nhttps://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuardHome-strict.txt",
    "importedLists": [
      "https://anti-ad.net/adguard.txt",
      "https://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuard.txt",
      "https://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuardHome-strict.txt"
    ],
    "popupPanelSections": 31
  },
  "selectedFilterLists": [
    "user-filters",
    "ublock-filters",
    "ublock-badware",
    "ublock-privacy",
    "ublock-abuse",
    "ublock-unbreak",
    "adguard-generic",
    "adguard-mobile",
    "easylist",
    "adguard-spyware",
    "adguard-spyware-url",
    "block-lan",
    "easyprivacy",
    "urlhaus-1",
    "curben-phishing",
    "curben-pup",
    "adguard-annoyance",
    "adguard-social",
    "fanboy-thirdparty_social",
    "fanboy-cookiemonster",
    "fanboy-annoyance",
    "fanboy-social",
    "ublock-annoyances",
    "dpollock-0",
    "mvps-0",
    "plowe-0",
    "CHN-0",
    "https://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuard.txt",
    "https://raw.githubusercontent.com/cxw620/AdGuard-Rules/main/wjx-AdGuardHome-strict.txt",
    "https://anti-ad.net/adguard.txt"
  ],
  "hiddenSettings": {
    "autoUpdatePeriod": 1,
    "consoleLogLevel": "info",
    "updateAssetBypassBrowserCache": true
  },
  "whitelist": [
    "about-scheme",
    "cdn.ctyun.cn",
    "chrome-extension-scheme",
    "chrome-scheme",
    "edge-scheme",
    "login.partner.microsoftonline.cn",
    "moz-extension-scheme",
    "opera-scheme",
    "portal.office.com",
    "portal.partner.microsoftonline.cn",
    "read.celestial-star.ltd",
    "uptimerobot.com",
    "vivaldi-scheme",
    "www.bilibili.com",
    "wyciwyg-scheme"
  ],
  "dynamicFilteringString": "behind-the-scene * * noop\nbehind-the-scene * inline-script noop\nbehind-the-scene * 1p-script noop\nbehind-the-scene * 3p-script noop\nbehind-the-scene * 3p-frame noop\nbehind-the-scene * image noop\nbehind-the-scene * 3p noop",
  "urlFilteringString": "",
  "hostnameSwitchesString": "no-large-media: behind-the-scene false\nno-csp-reports: * true\nno-strict-blocking: passport.biligame.com true",
  "userFilters": "! Title: 浏览器补充规则\n! Update Time: 2022-01-22 16:18:00\n! Ver.: 1.0.10\n! Update Details\n!! --------------------\n!! 首次更新\n!! --------------------\n! Notes\n!! --------------------\n!! 本规则包含了浏览器规则,适合ADB,AdGuard,ublock使用\n!! --------------------\n\n!! --------------------\n! [页面规则]\n!! 以下为url参数拦截\n!! [Baidu]\n||*baidu*$removeparam=rsv_sug1\n||*baidu*$removeparam=rsv_sug2\n||*baidu*$removeparam=rsv_sug3\n||*baidu*$removeparam=rsv_sug4\n||*baidu*$removeparam=rsv_sug5\n||*baidu*$removeparam=rsv_cq\n||*baidu*$removeparam=rsv_dl\n||*baidu*$removeparam=rsv_bp\n||*baidu*$removeparam=rsv_pq\n||*baidu*$removeparam=rsv_enter\n||*baidu*$removeparam=rsv_jmp\n||*baidu*$removeparam=rsv_btype\n||*baidu*$removeparam=rqlang\n||*baidu*$removeparam=oq\n||*baidu*$removeparam=rqid\n||*baidu*$removeparam=rsf\n||*baidu*$removeparam=sa\n||*baidu*$removeparam=bs\n||*baidu*$removeparam=usm\n||*baidu*$removeparam=tn\n||*baidu*$removeparam=dyTabStr\n||*baidu*$removeparam=euri\n||*baidu*$removeparam=lm\n||*baidu*$removeparam=ps\n||*baidu*$removeparam=ct\n||*baidu*$removeparam=cl\n||*baidu*$removeparam=nc\n||*baidu*$removeparam=wrsv_spt\n@@||image.baidu.com$removeparam=tn\n||*baidu*$removeparam=pn\n||*baidu*$removeparam=rn\n||*baidu*$removeparam=rtt\n||*baidu*$removeparam=bsst\n||*baidu*$removeparam=s\n||*baidu*$removeparam=fr\n||*baidu*$removeparam=inputT\n||*baidu*$removeparam=aptstamp\n||*baidu*$removeparam=top\n||*baidu*$removeparam=total_res_num\n||*baidu*$removeparam=frsrcid\n||*baidu*$removeparam=frorder\n||*baidu*$removeparam=lid\n||*baidu*$removeparam=sf_ref\n||*baidu*$removeparam=pcEqid\n||*baidu*$removeparam=fromtitle\n||*baidu*$removeparam=fromid\n||*baidu*$removeparam=ala\n||*baidu*$removeparam=alatpl\n||*baidu*$removeparam=pos\n||*baidu*$removeparam=wfr\n||*baidu*$removeparam=for\n!! [Google]\n$removeparam=iflsig\n$removeparam=ved\n$removeparam=uact\n$removeparam=sclient\n!! [bing]\n||*bing*$removeparam=form\n||*bing*$removeparam=FORM\n||*bing*$removeparam=sp\n||*bing*$removeparam=pq\n||*bing*$removeparam=sc\n||*bing*$removeparam=qs\n||*bing*$removeparam=sk\n||*bing*$removeparam=cvid\n!! --------------------\n!! 以下为广告拦截\n"
}
@iam-py-test
Copy link
Contributor

I'm not sure, but this may be caused by use of History.replaceState
uBo does not register that a new website was loaded, so can not filter it. I think this is more of a browser issue than a uBo one

@uBlock-user
Copy link
Contributor

Only network requests get filtered, cosmetic replacement of url not.

@uBlock-user uBlock-user transferred this issue from uBlockOrigin/uAssets Jan 26, 2022
@uBlock-user
Copy link
Contributor

Duplicate of #1767

@uBlock-user uBlock-user marked this as a duplicate of #1767 Jan 26, 2022
@iam-py-test
Copy link
Contributor

iam-py-test commented Jan 26, 2022

Maybe new scriptlet to overwrite History.replaceState:

(function(){
History.prototype.replaceState = function(stateObj, title,url){
if(url !== ""){
location.href = url
}
}
History.prototype.pushState = function(stateObj, title,url){
if(url !== ""){
location.href = url
}
}
})()

Edit: uses History.pushState not replaceState

@uBlock-user uBlock-user added the duplicate This issue or pull request already exists label Jan 26, 2022
@cxw620
Copy link
Author

cxw620 commented Jan 26, 2022

I found that if i use regular expression like this:||*baidu*$removeparam=/^[^wu]([^dr]{0,})([^l]{0,}).*/
and cancel such function of Baidu:
image
the page seemed to be forced to reload and ubo works, although i takes more time to finish loading the page

@iam-py-test
Copy link
Contributor

If that solution works

@gwarser
Copy link

gwarser commented Jan 26, 2022

Is it "Search settings" -> "Do you want to display search results in real time as you type" (if translated correctly)?

@cxw620
Copy link
Author

cxw620 commented Jan 28, 2022

Is it "Search settings" -> "Do you want to display search results in real time as you type" (if translated correctly)?

translation is correct. however i found that sometimes such solution didn't work. it really confuses me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants