My Chrome extension doesn't seem to execute console.log
in any way. It skips it.
console.log
works: I can open the Console, type console.log('test');
and it works. It works from other scripts, i.e. a JS script loaded in a HTML page locally, but not from my extension.
My background.js
that I run through manifest.json
below. It executes alert()
, but not console.log
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(null, { file: "jquery-3.0.0.min.js" }, function() {
console.log('----');
alert('Hello!);
});
});
I've tried:
delete console.log
,delete window.console
anddelete window[console]
as suggested by Restoring console.log() and JavaScript console log in Magento, but no success.- loaded the extension in Incognito mode, with no other extensions loaded, but no success.
- updated
background.js
to consist of only a single line -console.log('----');
- still doesn't work. - making sure that the console reports "All", not just errors.
My manifest.json
:
{
"manifest_version": 2,
"name": "My Chrome Extension",
"description": "This extension will you save time.",
"version": "1.0",
"permissions": [
"http://*/*",
"https://*/*",
"tabs"
],
"browser_action": {
"name": "Click to start the extension"
},
"background": {
"scripts": ["background.js"]
}
}