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

Add a redirectable script that sets canRunAds true #190

Closed
Yuki2718 opened this issue Feb 3, 2022 · 13 comments
Closed

Add a redirectable script that sets canRunAds true #190

Yuki2718 opened this issue Feb 3, 2022 · 13 comments

Comments

@Yuki2718
Copy link

Yuki2718 commented Feb 3, 2022

Related discussion: uBlockOrigin/uAssets@036e131
If this is added, we can add following very wide rules safely:

/prebid-ads.js$script,redirect=canrunads
/ads-prebid.js$script,redirect=canrunads

These should cover not only bigbtc.win but many more: https://publicwww.com/?q=%22%2Fprebid-ads.js%22+depth%3Aall See how many /prebid-ads.js or /ads-prebid.js rules are in Base filters.

@slavaleleka
Copy link
Contributor

so this redirect should simply set constant?

canRunAds = true

@Yuki2718
Copy link
Author

Yuki2718 commented Feb 3, 2022

so this redirect should simply set constant?

Yes. Here's an actual bait path: https://bigbtc.win/js/ads-prebid.js. Not all /prebid-ads.js or /ads-prebid.js work in this way but many.

@slavaleleka
Copy link
Contributor

there are a lot of prebid-ads scripts where different constant are used, so it might be overkill, don't you think?

just few of none-canrunads ones:

checkfresh.com/js/prebid-ads.js
playshakespeare.com/modules/mod_antiadblocker/assets/js/prebid-ads.js
techilife.com/wp-content/plugins/ad-blocker/assets/js/prebid-ads.js
leaklinks.com/js/prebid-ads.js
chipverify.com/modules/mod_ablockdetector/js/prebid-ads.js
note.sieuthuthuat.com/js/prebid-ads.js

@Yuki2718
Copy link
Author

Yuki2718 commented Feb 3, 2022

Whoa, that is what I certainly missed. It needs evaluation then.

From recent Base entries:
Works

playerdrive.me/assets/js/prebid-ads.js
swnovels.com/assets/js/prebid-ads.js
player.oyasumi.me/assets/js/prebid-ads.js
mangaalarab.com/app/js/ads-prebid.js

Doesn't work

zeroupload.com/js/js/prebid-ads.js
checkfresh.com/js/prebid-ads.js
www.playshakespeare.com/modules/mod_antiadblocker/assets/js/prebid-ads.js?2fb1b1cb4260432a28de51cf238b11c6
zerodmca.com/js/js/prebid-ads.js
sanctuary.moe/js/ads-prebid.js
lootup.me/assets/js/ads-prebid.js
universalfreecourse.com/ads-prebid.js
downloadfreecourse.com/ads-prebid.js

Looks worse than 50:50...

@Yuki2718
Copy link
Author

Yuki2718 commented Feb 4, 2022

A few more working cases:

hideandseek.world/js/prebid-ads.js
timebucks.com/publishers/js/prebid-ads.js
true-gaming.net/home/wp-content/themes/TrueGaming2021/js/prebid-ads.js
playmyopinion.com/assets/developer/js/prebid-ads.js

I think the resource is still overall worth, we just need to avoid $important so that non-working cases will not be affected if an exception is added. It won't negatively affect in those cases. Many of them create a random-id div or use an unique variable, but I found another commonly used variable of isAdBlockActive:

note.sieuthuthuat.com/js/prebid-ads.js
leaklinks.com/js/prebid-ads.js
getpaste.link/js/prebid-ads.js
sharetext.me/js/prebid-ads.js
vippaste.xyz/js/prebid-ads.js

Probably setting isAdBlockActive to false too will improve its usefulness.
cc @gorhill

@ameshkov
Copy link
Member

ameshkov commented Feb 5, 2022

Okay, there're two possible approaches:

  1. One redirect stub that combines many constants in it (constant-detection-stubs)
  2. Multiple stubs, one per constant (constant-canrunads, constant-isadblockactive)

Which one do you think is better?

CC @AdguardTeam/filters-maintainers

@Yuki2718
Copy link
Author

Yuki2718 commented Feb 5, 2022

I emphasize that the actual use will be generic filter. There's not much sense to use this only for specific domain as we can use and has been using scriptlet for that.

@AdamWr
Copy link
Member

AdamWr commented Feb 7, 2022

I would prefer one redirect (constant-detection-stubs) with two or few most popular/used constants, so it could cover more cases if it would be used as a generic rule.

@slavaleleka slavaleleka added the enhancement Improvement of existent feature label Feb 7, 2022
@gorhill
Copy link
Contributor

gorhill commented Feb 7, 2022

Personally I prefer one constant per stub, otherwise this causes a user to stand out as using a content blocker . i.e. a site could load a script which set canRunAds and then test if isAdblockActive is true to find out that the visitor is most certainly using a content blocker -- which then defeat the purpose of the stub.

@Yuki2718
Copy link
Author

Yuki2718 commented Feb 7, 2022

I actually considered about that but that's no worse than not using stub (no fix) - detected by blocking prebid-ads. Also such detection can be done even with one-constant stub (a website can use a constant inversely - check whether canRunAds is true to detect). We anyway can't hide the fact user is using content blocker as long as it blocks something.

@gorhill
Copy link
Contributor

gorhill commented Feb 7, 2022

Ok I see, the same script file name is used as bait for either sentinel variables, and it wouldn't be possible to create a generic filter that set both variables with one single redirection.

gorhill added a commit to gorhill/uBlock that referenced this issue Feb 7, 2022
commit 34a290b
Author: Yuki2718 <[email protected]>
Date:   Mon Feb 7 19:14:02 2022 +0900

    update last commit

commit f34ffbc
Author: Yuki2718 <[email protected]>
Date:   Mon Feb 7 19:05:17 2022 +0900

    Improve and rename canrunads.js

Related issue:
- AdguardTeam/Scriptlets#190

Related commit:
- e8bfc9a
@slavaleleka
Copy link
Contributor

@gorhill I see you've already created a single redirect for few variables

@Yuki2718
Copy link
Author

I made commits after the comment: gorhill/uBlock@ef25f30

adguard pushed a commit that referenced this issue Feb 18, 2022
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-12558 to release/v1.6

Squashed commit of the following:

commit b89b88b
Merge: 68813a6 7f8bebf
Author: Stanislav A <[email protected]>
Date:   Fri Feb 18 16:36:56 2022 +0300

    Merge branch 'release/v1.6' into fix/AG-12558

commit 68813a6
Author: Stanislav A <[email protected]>
Date:   Fri Feb 18 13:43:28 2022 +0300

    update compatibility-table

commit 13cc688
Author: Stanislav A <[email protected]>
Date:   Fri Feb 18 13:15:15 2022 +0300

    description fix

commit 9e7e637
Author: Stanislav A <[email protected]>
Date:   Fri Feb 18 12:59:57 2022 +0300

    rename redirect

commit 6181870
Author: Stanislav A <[email protected]>
Date:   Thu Feb 17 17:13:39 2022 +0300

    add constant-detection-stubs redirect
adguard pushed a commit that referenced this issue Mar 24, 2022
* commit 'c06a8e539488e1ebfcf72c85a39a0ef5b9c028bb': (32 commits)
  AG-13382 update docs, validate noopjson
  push updated dist to github while release build. AG-13356
  remove tagcommander redirect AG-11959
  add readme info about testing ad debugging AG-12716
  add artifacts to scriptlets builds AG-12487
  improve set-constant scriptlet #65 AG-149
  improve prevent-xhr scriptlet #199 AG-13007
  improve googletagservices-gpt redirect #193 AG-12767
  add wcslog redirect #94 AG-3906
  improve ati-smarttag redirect #200 AG-13141
  improve json-prune scriptlet #171 AG-11879
  fix yandex metrika on avito #198 AG-12973
  improve metrika-yandex-tag redirect #189 AG-12550
  add prebid-ads redirect #190 AG-12558
  remove no-floc scriptlet AG-12869
  add noopjson redirect. AG-12796 #195
  Revert "revert tests and fix converter again"
  revert tests and fix converter again
  add conversion test for wildcard tld AG-12636
  add prevent-element-src-loading scriptlet #180 AG-12328
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants