Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. chrome.tabs.executeScript not working?
  2. <html>
  3. <script>
  4.     chrome.browserAction.onClicked.addListener(function(tab) {
  5.         chrome.tabs.executeScript(null,{code:"document.body.bgColor='red'"});
  6.         chrome.tabs.executeScript(null, {file: "content_script.js"});
  7.     });
  8. </script>
  9. </html>
  10.        
  11. "permissions": [
  12.     "tabs", "http://*/*", "https://*/*"
  13. ]
  14.        
  15. chrome.tabs.executeScript(null,{code:"document.body.style.backgroundColor='red'"});