Port error: Could not establish connection. Receiving end does not exist. In Chromiume

前端 未结 17 2386
甜味超标
甜味超标 2020-12-05 09:26

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:         


        
17条回答
  •  暖寄归人
    2020-12-05 09:46

    The problem could be that sendRequest() and onRequest have been deprecated and replaced with sendMessage() and onMessage. Since a recent Chrome 20 update they seem to be gone completely.

    The official documentation on Message Passing doesn't even mention sendRequest() anymore.

    Here is a link which documents the change a little bit: http://codereview.chromium.org/9965005/

提交回复
热议问题