Add support for contingency messaging#9083
Open
CrisBarreiro wants to merge 1 commit into
Open
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4f76570 to
540ac9e
Compare
ad28b40 to
60e63f7
Compare
1cbd817 to
d244f17
Compare
60e63f7 to
abec109
Compare
d244f17 to
f40c3e2
Compare
183d4bf to
9bf11e2
Compare
f40c3e2 to
b98719b
Compare
9bf11e2 to
cfb68de
Compare
cfb68de to
1af6633
Compare
1af6633 to
878d441
Compare
This was referenced Jul 8, 2026
cdffe40 to
c4b2af4
Compare
fd2e2b1 to
84e11a7
Compare
This was referenced Jul 9, 2026
18ff115 to
f713425
Compare
84e11a7 to
1b4d2da
Compare
1b4d2da to
c62ca18
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c62ca18. Configure here.
cmonfortep
approved these changes
Jul 9, 2026
cmonfortep
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Just few recommendations to avoid showing the sheet on race conditions, or on wrong sites.
Show a one-off bottom sheet when ad-blocking contingency mode is enabled and the user visits YouTube, gated behind the adBlockingUXImprovements flag. It shows once per contingency-enabled period; the shown state is reset when contingency mode is disabled (observed via the toggle's enabled() flow in MainProcessLifecycleObserver.onCreate). Driven by AdBlockingExtensionJsInjectorPlugin on page load, which notifies the internal ContingencyMessageHandler, keeping JS injection and UI concerns separated. No changes to any -api module.
c62ca18 to
da76a95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Task/Issue URL: https://app.asana.com/1/137249556945/project/72649045549333/task/1214489465023873?focus=true
Tech Design URL (if applicable):
Description
Add support for contingency messaging:
Steps to test this PR
Feature 1
UI changes
Note
Medium Risk
User-visible browser and settings behavior tied to remote feature flags, including when script injection is skipped in contingency mode elsewhere in the module; well-tested but worth validating navigation timing and one-shot messaging edge cases.
Overview
Adds contingency messaging when remote flags
adBlockingUXImprovementsandenableContingencyModeare on, so users are told YouTube ad blocking is temporarily unavailable instead of seeing a broken toggle or silent failure.On YouTube extension domains, a one-time bottom sheet is shown after page load (deferred until the WebView has window focus); pending shows are cancelled on the next
onPageStarted. Whether the message already appeared is persisted in DataStore and resets when contingency mode is turned off.Ad Blocking settings (v2) switches to a read-only contingency row (warning icon + copy) and hides the block-ads toggle and description; the header status indicator stays off in contingency mode even if blocking would otherwise be enabled.
Contingency copy and v2 settings strings are added across locales (moved out of
donottranslate.xml).Reviewed by Cursor Bugbot for commit da76a95. Bugbot is set up for automated code reviews on this repo. Configure here.