简体   繁体   English

Firefox插件:在弹出窗口中访问存储

[英]Firefox addon : Access to storage in the popup

I would like to access to the storage from a script loaded via the popup HTML of the toolbar button. 我想通过通过工具栏按钮的弹出HTML加载的脚本访问存储。

Like that : browser.storage.local.get(key) 像这样: browser.storage.local.get(key)

The problem is that the browser object is undefined. 问题是browser对象未定义。

Ok, my bad, the browser object is defined even in the popup. 好的,不好,即使在弹出窗口中也定义了browser对象。 The "undefined error" was fired when I tried to run my code outside of the popup. 当我尝试在弹出窗口之外运行代码时,触发了“未定义的错误”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM