Tutorials of "Implement a settings page" should use synced storage

RESOLVED FIXED

Status

P1
normal
RESOLVED FIXED
a year ago
5 months ago

People

(Reporter: xidorn, Assigned: ismith)

Tracking

Details

(Reporter)

Description

a year ago
The example in "Implement a settings page" is currently using code:
> function saveOptions(e) {
>   e.preventDefault();
>   browser.storage.local.set({
>     color: document.querySelector("#color").value
>   });
> }

However, I believe developers and users generally want to sync the options of addons across different devices, so I think this example code should really use storage.sync by default, and explain that developers can also use storage.local if they think some options are better kept locally in a note after.

(I'm not sure whether this matches the teams' thought, so I file a bug instead of editing the page directly.)
Priority: -- → P2
Assignee: nobody → ismith
Priority: P2 → P1
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Implement_a_settings_page$edit

Updated the page so that the example uses storage.sync instead of storage.local
I also added the necessary id key to the manifest

Finally, modified the code description to talk about storage.syn and added a note that is possible to store settings in local storage instead.
Flags: needinfo?(xidorn+moz)
(In reply to Irene Smith (ismith) from comment #1)
> https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/
> Implement_a_settings_page$edit
> 
> Updated the page so that the example uses storage.sync instead of
> storage.local
> I also added the necessary id key to the manifest
> 
> Finally, modified the code description to talk about storage.syn and added a
> note that is possible to store settings in local storage instead.

Wrong page link. Use:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Implement_a_settings_page

instead.
(Reporter)

Comment 3

6 months ago
Looks good to me.
Flags: needinfo?(xidorn+moz)
(Assignee)

Comment 4

5 months ago
I'm marking this as resolved.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.