Chrome extension storage.sync.set in content script throws exception

后端 未结 3 984
旧时难觅i
旧时难觅i 2021-02-19 07:03

I have a weird issue that wasted too much time. I have content script that tries to read some data from the storage.sync API but it fails.

I\'ve added the storage permis

相关标签:
3条回答
  • 2021-02-19 07:46

    I was also getting this same error. I fixed it by disabling and re-enabling my Chrome browser extensions. Hope that helps.

    0 讨论(0)
  • 2021-02-19 07:46

    I had the same problem when injecting code into a html page. Using new id's immediately after injecting them into the page html seems to crash the debugger but not the page itself. Everything works and the error message only pops once on injecting the code. It looks like it was coming from the cache. It just happened once on refreshing the page and never after clearing cache... Sorry not very useful, but this is what I had and could not reproduce anymore.

    0 讨论(0)
  • 2021-02-19 07:57

    I had the same error and it was caused due to debugger stopping the flow of execution in the middle. Once I removed the debugger / breakpoints in my 'Content Script' and 'Background Script' and reloaded everything then I didn't see the error.

    0 讨论(0)
提交回复
热议问题