Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to not add content scripts to existing tabs after enabling a web extension?

25 views
Skip to first unread message

webseiten...@googlemail.com

unread,
Oct 6, 2016, 11:47:09 AM10/6/16
to
Hello,

I wrote a web extension that uses content scripts exclusively. Unlike Chrome, the scripts are injected into existing tabs when enabling the extension. This leads to CSS and HTML fragments to be added twice by my script if someone enables-disables-enables the extension. Since I (presumably) can't tidy up when the extension gets disabled, is there a way of disabling this behavior?

Regards

Jorge Villalobos

unread,
Oct 6, 2016, 12:36:20 PM10/6/16
to
That sounds like a bug that should be reported here:
https://bugzilla.mozilla.org/enter_bug.cgi?product=Toolkit&component=WebExtensions

And to give more of an answer, can't your script detect that it has
already acted on a page in order to avoid duplication?

Jorge
0 new messages