httpswitchboard
httpswitchboard copied to clipboard
Contemplate using chrome.tabs.injectScript for content scripting
With cosmetic filtering, there are now really 4 possible flavor for content scripting:
- no UA spoofing, no cosmetic filtering
- UA spoofing, no cosmetic filtering
- no UA spoofing, cosmetic filtering
- UA spoofing, cosmetic filtering
In the spirit of efficiency, not executing code for UA spoofing and cosmetic filtering is desirable when those features are not enabled.
The solution is to inject only the necessary content scripts, and this can be done only through the use of chrome.tabs.injectScript.
HTTPSB used to use this instead of simpler declarative content scripting, I will have to experiment again to find out the best point of injection (used to be based on webNavigation).