Skip to content

Disconnect the cookie banner observer before replacing it - #1531

Merged
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1489
Aug 27, 2026
Merged

Disconnect the cookie banner observer before replacing it#1531
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/vws-web-tools-issue-1489

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #1489.

_dismiss_cookie_banner installed a MutationObserver on document.documentElement and nothing ever disconnected it. It was guarded by if (!window.__otObserver), which meant a second observer was not installed on a document that already had one — but the guard also meant an existing observer was left running with no way to stop it, and the intent ("only one observer") was expressed as "never replace" rather than as "replace the old one".

The observer now disconnects before being replaced. Since window.__otObserver and the observer are both scoped to a document, a page load clears both together, so this changes nothing in the common case; it makes the single-observer invariant hold explicitly and gives the observer an actual disconnect.

_dismiss_cookie_banner is called on every navigation and from wait_for_logged_in, so a session that stays on one page across many calls is where this matters.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM

Closes #1489

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
@adamtheturtle
adamtheturtle merged commit af32f8c into main Aug 27, 2026
29 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vws-web-tools-issue-1489 branch August 27, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_dismiss_cookie_banner MutationObserver never disconnected

1 participant