Why is chrome.runtime undefined?

后端 未结 2 1606
借酒劲吻你
借酒劲吻你 2020-12-21 05:17

I am creating a Google Chrome extension (my first one) and I want to send messages from the extension to the current tab.

I am following the documentation:

h

2条回答
  •  悲&欢浪女
    2020-12-21 05:35

    or it could just be a Heisenbug which only appears under certain circumstances. in my case, closing the chrome://extensions tab and refreshing my target caused chrome.runtime to be available again. Why is chrome.runtime undefined in the content script?

提交回复
热议问题