0

first of all I'm at first approach with Chrome Extension. I'm trying to make a communication between the contentscript.js and the background.html but I get this error:

Port error: Could not establish connection. Receiving end does not exist. miscellaneous_bindings:235 chromeHidden.Port.dispatchOnDisconnect

Here are the pieces of code:

manifest.json http://pastebin.com/FFk3PEs3

contentscript.js http://pastebin.com/dwK9vrTB

background.js http://pastebin.com/Zudw4DZb

I don't get why the port error occures and looking on the development section of chrome I don't even find info about sendRequest, but just sendMessage... is sendRequest deprecated? I've read about the inline JS not executed and changed the manifest bust still got the error.

Mind that this is a piece of code not written by me, but I'm playing with it to learn how to make extensions.

Thank you in advance!

4

1 回答 1

-1

将 sendRequest 替换为 sendMessage 并将 onRequest 替换为 sendRequest ,一切正常!

于 2012-12-28T14:58:31.020 回答