Content script attached to tab detaches when URL changes

Talk about add-ons and extension development.
Post Reply
smellyfinger
Posts: 28
Joined: January 11th, 2014, 9:54 am

Content script attached to tab detaches when URL changes

Post by smellyfinger »

Hi guys

I have a WebExtension that needs to continuously monitor a tab even if it changes URL. I have attached an example addon to show the behavior here https://www.dropbox.com/s/zzzkxi02jmhos ... 3.zip?dl=0. Press the addon toolbar button and it opens a new tab with google.com. Open the browser console in this tab and you'll see Hello messages printed continuously. Now perform a search and the printing stops and also the content script is not shown in the debugger anymore.

A similar addon used to work but that behavior seems to have changed (silently?) in recent versions of Firefox and my addon is now broken. I tested this on Firefox Developer Edition 55.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: Content script attached to tab detaches when URL changes

Post by lithopsian »

Something very strange going on with addon scripts recently. I've had similar problems. Have you checked that the script is actually removed, or does it just stop getting events and messages? Does it happen when multiprocess is turned off?
smellyfinger
Posts: 28
Joined: January 11th, 2014, 9:54 am

Re: Content script attached to tab detaches when URL changes

Post by smellyfinger »

@lithopsian yes the content script the removed from the page according to the debugger window. I'm not sure how to disable multiprocess though.
Post Reply