fix: Shadow DOM isolation, API error masking, and incomplete logout cleanup#59
Draft
fix: Shadow DOM isolation, API error masking, and incomplete logout cleanup#59
Conversation
…logout cleanup
- selection-overlay.ts: wrap overlay elements in a closed Shadow DOM to
prevent host-page CSS/JS interference with the capture UI
- ApiClient.ts: treat 204 No Content gracefully and throw ApiError for
any other non-JSON content type instead of silently returning {}
- IndexedDBService.ts: add clearAllAssets() to wipe the assets store
- StorageService.ts: call indexedDBService.clearAllAssets() from clearAll()
so logout removes screenshots, GPS coords, and URLs from IndexedDB
Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix content script DOM exposure and incomplete logout cleanup
fix: Shadow DOM isolation, API error masking, and incomplete logout cleanup
Mar 19, 2026
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.
Three medium-severity security issues in the content script, API client, and storage layer: host-page interference with the capture UI, silent masking of non-JSON server errors, and sensitive user data persisting in IndexedDB after logout.
Changes
src/content/selection-overlay.ts— Shadow DOM isolationmode: 'closed') on a host<div>document.getElementByIdor.shadowRootsrc/services/ApiClient.ts— Surface non-JSON server errors{} as Tapplication/jsoncontent type throwApiErrorinstead of silently returning{}, surfacing 502/503 HTML error pages and other unexpected responses to callerssrc/services/IndexedDBService.ts+StorageService.ts— Clear IndexedDB on logoutclearAllAssets()toIndexedDBService— clears theassetsobject store via a readwrite transactionStorageService.clearAll()now also callsindexedDBService.clearAllAssets(), so screenshots (base64 images), GPS coordinates, and source website URLs are removed fromProofSnapDBat logoutOriginal prompt
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.