Hi! I could reproduce this with a simple call to connect on the content script (browser.runtime.connect({ name: 'test' })) with just the listener on the background side:
browser.runtime.onConnect.addListener((p) => {
		console.log('port connected', p);
});
The listener is never triggered.
The rest of the code (including the manifest) is just the boilerplate created by xcode. I change a few things in the manifest like adding the content script to every page and added "<all_urls>" permission but nothing more (it happens with or without these manifest changes).
Thanks a lot!
Post
Replies
Boosts
Views
Activity
Hi, thanks for the answer.
Yes, I did all that. Breakpoint, console.log etc. The content script is injected, it runs everything.
The content script is what I posted before, I think it was not clear from the previous message:
browser.runtime.connect({ name: 'test' })
I did try also sending a message afterwards with the port that returns from the connect fn in the content script (it does return a port in the content script, it just doesn't trigger the listener in the background).
I forgot to mention I ran the exact same thing in Firefox and it worked, to test if I was possibly doing something wrong.
Hi! Are there any news on this? Were you guys able to reproduce it?