For an add-on I’m currently writing I need to do things with content pages that are not possible from a WebExtension content script.
Because it is not (yet) possible to write WebExtension Experiment APIs for content scripts, I use an experiment API from the background script that creates process/frame scripts which in turn load my original content script with the extended functionality I need.
So for everything works surprisingly well, with one major problem:
I can’t map the tabs the frame scripts are attached to the tabId
s of the WebExtension context.
What I found is that the mapping is done in the TabManager
here.
But:
// This file provides some useful code for the |tabs| and |windows|
// modules. All of the code is installed on |global|, which is a scope
// shared among the different ext-*.js scripts.
Is there a way to access that global context or get the TabManager
in any other way?