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

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

    I met up with this problem because I added a listener in background.js, and when invoked it would send a message to the popup page for view state update. While sometimes the listener is invoked, the popup page does not indeed exist. I check to make sure the popup page exists before sending a message and avoid this problem.

提交回复
热议问题