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

前端 未结 17 2413
甜味超标
甜味超标 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:33

    I was seeing this error using manifest_version: 2 and chrome.runtime.sendMessage. I am connecting from a web page to the extension instead of within the extension.

    The solution was to make sure I had the correct values in the externally_connectable.matches array in manifest.json. You need to list the URLs that you want to be able to connect to the extension. See https://developer.chrome.com/extensions/manifest/externally_connectable#without-externally-connectable.

提交回复
热议问题