Unable to log to storage.
I don't understand the grammar of the sample code and I don't think I know how to describe the key and value, but I don't know what's wrong with the browser's inspectors because they don't record anything in local storage.
manifest
"permissions": ["storage", "activeTab", "tabs",
contents script
var pref=["a", "b", "c"]; // value array
pref=browser.storage.local.set({key:"pref"});
Modify the code as follows:
var pref=["a", "b", "c"];
browser.storage.local.set({"key":pref});
© 2024 OneMinuteCode. All rights reserved.