Add support for internal links
Background
In #9 (closed) we want to open the settings page and focus a particular section within it from within a notification. Notifications can only contain links that refer to documentation link IDs which means that this feature is currently not possible.
What to change
- Add support for internal URIs
- For use in the background page: Add
openLink()
function to adblockpluschrome/lib/options.js that accepts either a documentation link ID or an internal URI.- When passing it a documentation link ID, open the page as usual.
- When passing it an internal URI, parse it and run the necessary actions (see below).
- For use in UI pages: Change "app.open" message to accept either a documentation link ID or an internal URI.
- For use in the background page: Add
- Replace instances where
browser.tabs.create({url})
is called directly. - Adapt instances where "app.open" is being used.
- Update docs/messaging.md.
Internal URI format
"ui:" page [ "#" section ]
Supported URIs
-
ui:settings
: Open settings page -
ui:settings#notifications
: Open settings page, switch to Advanced tab and focus "Show useful notifications" option