I'm developing an extension in Chrome, and there's a problem. In my inject.js
, I make a request like:
chrome.extension.sendRequest({command:'skip'},callback)
and in my `background.js I simply add a request Listener like:
chrome.extension.onrequest.addListener(function(req,sender,res){console.log("procession"})
But there's an error:
Port error: Could not establish connection. Receiving end does not exist
It seems a bug in chrome?
PS:
part of my manifest.json
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"matches": ["< all_urls >"],
"js": ["inject.js"]
}
],
I'm in Chromium 17, and I tried reloading the extension, reopening the browser... nothing happened
some one get some ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…