chrome.storage.sync undefined?

前端 未结 4 1144
一整个雨季
一整个雨季 2020-12-04 23:05

I\'m trying to use chrome storage in an extension, via a content_script, but I keep failing on

Uncaught TypeError: Cannot read property \'sync\' of undefine         


        
4条回答
  •  眼角桃花
    2020-12-04 23:59

    If someone was facing this issue on Firefox, please note, that it is not supported yet:

    https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage#Chrome_incompatibilities

    For my purposes it was sufficient to replace chrome.storage.sync by chrome.storage.local.

    Regarding the Firefox implementation state it might be worth to look also here from time to time:

    http://arewewebextensionsyet.com/#storage

提交回复
热议问题