Answer the question
In order to leave comments, you need to log in
How to access the source code of an open tab?
Hi. I am writing an extension for chrome. In the open tab, I click on the extension, it should change the background of the site. But nothing happens, the console is clean.
chrome.browserAction.onUpdated.addListener(function(tab) {
chrome.tabs.executeScript(tab.id,{code:"document.body.style.background='red'"});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question