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

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

    For manifest 2.0 and sendMessage case its fairly straight-forward:

    This happens if you try to use sendMessage inside the popup and there's no listener setup on background script end or the listener has somehow been removed.

    By listener I mean - chrome.runtime.onMessage.addListener.

提交回复
热议问题