Questions tagged [webextension-storage]

Use this tag for questions about the storage Mozilla Browser Extension. This property enables extensions to store and retrieve data, and listen for changes to stored items. The storage system is based on the Web Storage API.

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

storage.StorageArea.get()
Retrieves one or more items from the storage area.
storage.StorageArea.getBytesInUse()
Gets the amount of storage space (in bytes) used one or more items being stored in the storage area.
storage.StorageArea.set()
Stores one or more items in the storage area. If the item already exists, its value will be updated. When you set a value, the storage.onChanged event will fire.
storage.StorageArea.remove()
Removes one or more items from the storage area.
storage.StorageArea.clear()
Removes all items from the storage area.

12 questions
3
votes
1 answer

Are there any restrictions on access to browser extensions storage?

I'm trying to understand security implications of using browser extensions storage. A few things are not clear to me when I read the WebExtensions storage documentation. Documentation says among others that: Values are scoped to the extension, not…
2
votes
0 answers

Communication between background script and Incognito background script (when using "incognito": "split" mode)

I have many big images stored in the IndexedDB database but when I start Incognito window, I cannot access this database. Only chrome.storage.local is shared between normal and Incognito instances but it's limited to 5MB so I can't use it to share…
icl7126
  • 5,740
  • 4
  • 53
  • 51
2
votes
0 answers

Get result of async API call from regular function/method

Work on my most recent Firefox Webextension requires that I call into an async API function (browser.storage.local.get()). This, however, means the result of the API call isn't easily available from a getter. Not without using the "await" keyword…
1
vote
0 answers

Storing same data into storage.sync, Chrome uses much more quota than Firefox

Background I'm working on a browser addon (webextension API), which is cross-browser (Firefox & Chromium/Chrome/Blink). I need to use browser.storage.sync (chrome.storage.sync on Chrome) to storage so that data can be synced. storage.sync limits…
1
vote
1 answer

Can't communicate between options and background in webextensions in Microsoft Edge

I'm building an extension for Microsoft Edge. I have an options page which saves some values to localStorage like that: localStorage.setItem('xxx', document.getElementById("xxx").value); And retrieves them in background script: var value1 =…
0
votes
1 answer

vue cli "live build" folder for chrome extension

I'm making an extension and using npm run build (with vue cli) to make my option page. I need to interact with chrome.local.storage. So for now every change I need to make a new build and then test it in the extension. It would be nice to have some…
0
votes
0 answers

Firefox Extension Global Variables and onInstalled

I have a chrome extension that uses the Omnibox API. I want to port this extension to firefox by myself. I've tried nearly everything that may help, and miserably, I'm exhausted and out of solutions. Anyway, the extension basically does these steps…
0
votes
0 answers

How to make many to many relation in browser sync storage?

I'm creating an extension which is gonna allow users to tag comments. In an SQL database I would create tables like that: comments: id int text string tags: id int tag_name string comment_tags: comment_id int tag_id int But…
0
votes
0 answers

can't save the data in the chrome extension storage

I can't save the data that is form data from index.html in the chrome local storage. I also tried to save the data in chrome sync storage but both are not working and already checked my local storage in chrome://extensions but, there were no…
0
votes
1 answer

"Storage" in manifest.json for web extension has no effect

I've added "storage" to my permissions array in the manifest.json file, but the browser console still reports ReferenceError: storage is not defined whenever I load it as a temporary extension in Firefox. What else can I even do here??
0
votes
2 answers

Firefox extensions: How to save the value of a javascript variable to local storage?

The popup of my extension has a checkbox: The way it's set up now, if I click on the extension icon on the toolbar and check the checkbox in the popup, the value of the…
-1
votes
1 answer

Why does my IndexedDB save function not work?

I am making an edge web extension game, I've got the game done, so now i have to do storage. I will use IndexedDB because webSQL will no longer be available soon. I made a save function, but i got an error. This is the function that calls the save…