Hi there,
Thanks for your help. I'm new to js and chrome extension.
This should be a simple problem but I'm having a hard time figuring it out =(.
So in my background.html, I have
in extractFieldsContentScript.js, I haveCode:// execute content script when the extension's icon is clicked chrome.browserAction.onClicked.addListener(function(tab) { chrome.tabs.executeScript(tab.id, {file: "extractFieldsContentScript.js"}); });
The problems areCode:var title; var url; var body; function extractFields() { title = document.title; url = document.url; body = document.body; console.error("in script"); } extractFields(); chrome.extension.sendRequest( {title: title, url: url, body: body}, function(response) { console.log(url + response.status); });
1. chrome not displaying the content script under "Developer Tools -> Scripts". This makes it impossible to debug the content script. Is this supposed to happen?
2. The script is not executed.has no effect. Instead I seeCode:console.error("in script");
chrome/ExtensionProcessBindings:96 Error during tabs.executeScript: Unknown error.
Please help! Thanks!


LinkBack URL
About LinkBacks



Reply With Quote