Add YouTube ad-blocking omnibar badge#9155
Open
CrisBarreiro wants to merge 8 commits into
Open
Conversation
f5e7e14 to
d413ce9
Compare
YouTube video->video navigations use history.pushState, which the WebView reports as a full page load (new back/forward entry with a new originalUrl). They therefore took the NewPage/pageChanged path, where the badge was deferred until progressChanged(100). Those navigations never re-run a 0->100 progress cycle, so the deferred badge was stranded and never shown (it appeared on the first load and then seemingly never again). Decide defer-vs-show from the live loading state at emit time (after getAnimation resolves) instead of a flag captured when the navigation started: a pushState nav never drops progress below 100% so it reads as not-loading and shows immediately; a genuine document load is still loading and defers to 100% as before, to avoid the badge being clobbered by the omnibar settling mid-load.
d413ce9 to
69843d9
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 69843d9. Configure here.
| is WebNavigationStateChange.PageCleared -> pageCleared() | ||
| is WebNavigationStateChange.UrlUpdated -> { | ||
| // Drop any prior page's deferred badge synchronously (see NewPage above). | ||
| resetAdBlockingAnimationState() |
Contributor
There was a problem hiding this comment.
UrlUpdated clears deferred YouTube badge
Medium Severity
During a full page load, UrlUpdated calls resetAdBlockingAnimationState(), which clears a deferred StartAdBlockingAnimation before progressChanged(100) can flush it. A follow-up in-load URL tweak for the same YouTube video is treated as SPA (pageChanged = false) and skipped, so the omnibar badge may never appear.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 69843d9. Configure here.
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/1214489465023871?focus=true
Tech Design URL (if applicable):
Description
Steps to test this PR
Feature 1
UI changes
Note
Medium Risk
Moderate risk from new navigation/progress race handling and omnibar animation exclusivity in core browser UI; limited to YouTube ad-blocking feedback when injection is enabled.
Overview
Adds an address-bar “YouTube Ad Block On” badge when ad blocking is active on supported YouTube video URLs (watch, shorts, live, clip), with rules so full loads/reloads always animate, SPA navigations only animate when the video id changes, and injection-disabled skips the badge.
The ad-blocking module exposes
AdBlockingOmnibarAnimationProvider; the browser tab wires page/url navigation into that API, defers the badge until load progress hits 100 when needed, clears stale state on navigation, and claims exclusivity so tracker/cookie omnibar animations are suppressed unless the badge is skipped (e.g. omnibar focused).The omnibar gains a dedicated ad-blocking animation path that cancels competing animations and reuses the existing cookie-style slide-in scene with a static icon and feature-owned copy/resources.
Reviewed by Cursor Bugbot for commit 69843d9. Bugbot is set up for automated code reviews on this repo. Configure here.