You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting a value to undefined has inconsistent behaviour across browsers.
What did you expect to see?
Have a warning noting the difference between the behaviour of setting a value to undefined.
In Firefox, setting a value to undefined will actually set it to undefined, while in other browsers, setting something to undefined is simply ignored and the original value is kept.
Do you have any supporting links, references, or citations?
Let's wait at least a week so that we can decide on the Firefox side how to address this inconsistency. If we decide to fix this, then the documentation update can be part of the bug resolution.
Regardless of the fix, the documentation should be updated as follows:
The recommendation for removing values is to use storageArea.remove
The recommendation for overwriting values with a void value is to use null (not undefined)
The behavior of calling storageArea.set({keyname: undefined}) is inconsistent across browsers. Chrome and Safari do NOT change the value of keyname, while Firefox currently overwrites keyname with undefined (or sometimes null, e.g. in the storage.sync API). The recommendation is to NOT use undefined as a value, but use one of the other two options for consistent behavior.
MDN URL
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea/set
What specific section or headline is this issue about?
Syntax > Parameters > keys
What information was incorrect, unhelpful, or incomplete?
As mentioned here:
w3c/webextensions#263
Setting a value to
undefined
has inconsistent behaviour across browsers.What did you expect to see?
Have a warning noting the difference between the behaviour of setting a value to undefined.
In
Firefox
, setting a value toundefined
will actually set it toundefined
, while in other browsers, setting something toundefined
is simply ignored and the original value is kept.Do you have any supporting links, references, or citations?
As mentioned here:
w3c/webextensions#263
In there, @Rob--W mentioned the relevant bug reports:
https://bugzilla.mozilla.org/show_bug.cgi?id=1499842
https://bugs.chromium.org/p/chromium/issues/detail?id=896503
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/mozilla/add-ons/webextensions/api/storage/storagearea/set
The text was updated successfully, but these errors were encountered: