If you are not restricted by Chrome's specs, what about add a filter similarly to https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/onBeforeRequest#Parameters ? To raise only event(s) we need.
Hi @21Naown, this has been added to the agenda for the May 9 WebExtensions triage meeting. Would you be able to join us? Wiki: https://wiki.mozilla.org/Add-ons/Contribute/Triage Agenda: https://docs.google.com/document/d/1q7UD3DxsT5z0lO3EbOyF9Iln32Wg_e9LYMdHZ80BEb4/edit#heading=h.34n4lirhljve
Hello, I will not be able to join the meeting you mentioned. Thank you for proposing to me!
In the tabs.onUpdated event you can examine the tabs and decide which tab to process and which tab to ignore. It might make it a few lines of code shorter, perhaps, but then there's a whole filter syntax we have to maintain long term when a few lines of JS would work. It might save a little bit of time because the WebExtension code no longer needs to call the extension. But that seems like a very minimal win for something that doesn't get called as much as, say the webRequest API. Since this can already be done and doesn't offer any performance benefit but does increase code maintainence this doesn't seem worth it.
This will actually help us a lot with performance, since we wind up sending huge numbers of these events even when most of them aren't needed, so I'd like us to implement it.