I'm not able to trigger multiple actions for single event listeners in javascript. I'm working on google chrome extensions. So when I tried to run this code below it doesn't work.
chrome.browserAction.onClicked.addListener(function(tab) {
var action_url = "javascript:window.print();";
chrome.tabs.update({url: action_url});
chrome.tabs.executeScript({
code: 'document.body.style.backgroundColor="green"'
});
});
I had interchanged the code for some other extension and was trying to execute wrong extension. So I made changes accordingly such that I put right code in the extension which I wanted to run.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.