Skip to content

Conversation

@ajczyzewska
Copy link
Contributor

This PR fixes two critical issues:
Missing alarms permission

  • Added "alarms" permission to manifest.json to resolve the chrome.alarms.onAlarm API error. Added fallback to setInterval if the API is unavailable.

Domain blocking not working

  • Improved the blocking logic in chrome.tabs.onUpdated listener:
  • Now checks both changeInfo.url and tab.url to catch all navigation events
  • Added filtering for chrome://, chrome-extension://, and about: URLs
  • Enhanced domain matching to handle both domain.com and www.domain.com variants
  • Added proper error handling and early returns for edge cases

Changes:

  • manifest.json: Added "alarms" to permissions array
  • background.js:
    -- Added safeguards around chrome.alarms API usage
    -- Improved URL checking logic in tab update listener
    -- Added support for www. subdomain variants

Copy link

@foull foull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ducin ducin merged commit f7bf617 into developer-jutra:main Dec 13, 2025
1 check failed
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.

4 participants