Show on-page dialog to users who encounter YouTube's ad wall
Background / User story
Some websites put up an ad wall for restricting access to certain visitors. Recently, we've been seeing similar experiments on YouTube and would therefore like to show an on-page dialog for users who see that wall, in order to provide them with helpful information on what they can do.
Related AdBlock issue: adblockinc/ext/adblock/adblock#473 (closed)
What to change
- Design: The latest version of this solution, AKA the 'landing page' option is visible here.
- Research: Current documentation can be found on our Notion page
- Spec: spec!427 (merged)
- Legal: TBD
-
Development:
- Detect YouTube's ad wall.
- Locally trigger showing an on-page dialog using some predefined content, depending on on whether YouTube is allowlisted.
- No translations for the dialog content necessary for now. Those will be provided in a subsequent release. Until then, the dialog should be shown to all users.
Hints for testers
- The dialog is disabled by default, but you can change the
isEnabled
constant in src/yt-wall-detection/shared/detection.ts fromfalse
totrue
to enable it. Alternatively, you can change its value in the generated extension builds where you find it in both background.js and yt-wall-detection.preload.js. - You can trigger the dialog by visiting YouTube and running
document.body.appendChild(document.createElement("ytd-enforcement-message-view-model"))
in the web page's JavaScript console. Depending on whether YouTube is allowlisted one or the other dialog should be shown. - The dialog will only be shown once per page load.
- Once the user has clicked the 'Learn More' button or clicked on close button, the dialog should no longer be shown.
- An error message may be shown in the console when the dialog is shown, which is due to https://gitlab.com/adblockinc/ext/adblockplus/adblockplusui/-/issues/1494 .
- On-page dialogs triggered from an IPM command should not be able to specify
timing: "immediate"
. - Due to a regression in #1512 (closed), IPM commands for showing on-page dialogs are being rejected (see #1558 (closed)).
Hints for translators
N/A
Edited by Thomas Greiner