Skip to content
Advertisement

Chrome Extension Opens new tab, send message to new tab

I have an App page (extension_id://app.html) I want to create a new tab:

JavaScript

however, when I send a message to this tab id it doesnt work.

here is the content.js script, but it doesn’t alert or console log

JavaScript

Advertisement

Answer

adding a setTimeout to call the send function works correctly, just have to have the page load and timer called perfectly, about 8 to 10 seconds is enough time for the page to load.

TIA

Advertisement