Reuse Messaging API for developer tools panel communication for Manifest v3
Background / User story
In #1080 (closed) we made the Messaging API resilient against the service worker going away, which is not the case for the developer tools panel, which relies on a separate communication channel with the background page. Furthermore, the logic that manages the records that are shown in the developer tools panel is located in the background page, and thereby affected by the problems with in-memory storage outlined in #1070 (closed).
Therefore we should reuse the existing Messaging API communication port, extend the existing "requests.*" messages and move the records management logic from the background page to the developer tools panel.
What to change
- Design: N/A
- Research: N/A
- Spec: N/A
- Legal: N/A
-
Development:
- Remove adblockpluschrome/ext/devtools.js in favor of js/api.js.
- Move records management logic from adblockpluschrome/lib/devtools.js to js/pages/devtools-panel.js by reusing existing "requests.listen" message.
- Extend capabilities of Messaging API backend to avoid performance problems:
- Allow for listening to requests for specific tabs.
- Dynamically add/remove internal listeners depending on whether there's demand for it (i.e. whether a UI page wants to receive those events).
Hints for testers
- Developer tools panel:
- No obvious errors or breakage.
Only Manifest v3: Including after service worker shuts down. Testing this requires EWE'sreporting.onBlockableItem
API to be compatible with Manifest v3. - List should reset when inspected tab gets reloaded.
- Reloading the inspected tab via the respective link in the developer tools panel should still work.
- Clicking on a URL should open the respective resource in the developer tools.
- Developer tools panel should be shown using darker colors when developer tools are used with dark mode.
- No obvious errors or breakage.
- There should be no memory leak due to opening/closing UI pages (incl. developer tools panel).
- The UI should react to events as expected (e.g. checkboxes should update when clicked, filters list should show up in UI when added, icon blocked counter should update on filter hits).
- Issue report data should contain titles of enabled subscriptions.
Hints for translators
N/A
Edited by Thomas Greiner