I am trying to send a message to a newly created / updated tab and get it there:
var tabAction = 'create';
chrome.tabs[tabAction]({
url: chrome.extension.getURL('/somepage.htm'),
active: true
}, function(_tab) {
chrome.tabs.sendMessage(_tab.id, {
message: 'some custom message',
arg: 'some arg'
});
});
After this call, one of the scripts (included in the title of the open page) should receive this message and perform the following actions:
(function(window, document, jQuery) {
"use strict";
chrome.runtime.onMessage.addListener(function(message) {
});
})(window, document, jQuery);
Now my problem is:
If tabAction is set to "create", everything works fine - the page loads, the main script sends a message, adds an extension debugger: "tabsendMessage is called" and "runtime.onMessage is notified" and the script page does what it should.
tabAction "" - , script , ; " tabs.sendMessage".
?
.