Problem: Extension showed permission error on extension:// URLs
Fix: Added extension:// to isRestrictedPage() function
Result: Now properly detects extension pages as restricted
Problem: Generic "Cannot send from browser internal pages" error
Fix: Changed to user-friendly message
New Message: "This extension cannot send data from browser internal pages (settings, extensions, etc.). Please navigate to a regular website and try again."
Problem: Context menu worked on restricted pages while popup didn't
Fix: Added restricted page check to context menu handler
Result: Both popup and context menu now behave consistently
Problem: CSP violations and errors with file:// favicons
Fix:
- Skip
file://URLs in favicon detection - Proper fallback to extension icon URL
- Keep existing
onerrorhandler in popup for broken images
Problem: Multiple ESLint errors in codebase
Fix: Fixed space-before-function-paren and unused variable issues
- URL:
https://example.com - Expected: Extension works normally
- Favicon: Uses site favicon or falls back properly
- URL:
extension://abc123/options.html - Expected: Shows friendly error message
- Behavior: Both popup and context menu show same error
- URL:
chrome://settings/oredge://settings/ - Expected: Shows friendly error message
- Behavior: Consistent between popup and context menu
- URL:
file:///path/to/file.html - Expected: Extension works but favicons fall back to extension icon
- Favicon: Skips
file://favicons, uses extension icon
- URL: Any page with non-existent favicon
- Expected: Extension works, favicon shows extension icon in preview
- Behavior: No console errors due to
onerrorhandler
- Better UX: Clear, actionable error messages
- Security: Proper CSP compliance for favicon handling
- Consistency: Same behavior across popup and context menu
- Reliability: Robust favicon fallback mechanism
- Clean Console: No more CSP violation errors in dev tools
package/utils.js: UpdatedisRestrictedPage()andgetFavicon()package/popup.js: UpdatedisRestrictedPage()and error messagepackage/background.js: Added context menu restriction check, fixed lintingtest-restricted-pages.html: Created test page for validation
The extension now properly handles the GitHub issue URL structure by:
- Detecting
extension://jcfjdkjadplcjlpddmbpiefkfgdaaabf/options.htmlas restricted - Falling back to
https://raw.githubusercontent.com/JOHLC/Send-to-Home-Assistant/refs/heads/main/assets/icon-256.pngfor favicon when needed (viachrome.runtime.getURL('icon-256.png')) - Providing consistent, user-friendly error messages across all interaction methods