Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add export feature #23

Closed
fregante opened this issue Jun 22, 2019 · 2 comments · Fixed by #65
Closed

Add export feature #23

fregante opened this issue Jun 22, 2019 · 2 comments · Fixed by #65

Comments

@fregante
Copy link
Owner

fregante commented Jun 22, 2019

From: refined-github/refined-github#2120

This is probably already feasible via:

copy(JSON.stringify(await options.getAll()))

options.setAll(JSON.parse(paste()))

However it needs to be easier to use or implement. Either:

  • add user-facing globals window.webextOptionsSync.export/import() so users can save the config without adding further UI to extensions, or
  • add options.export/import() methods that save to/from files, so this feature can be implemented as two buttons (i.e. via <a download> and <input type=file>)
@kiprasmel

This comment has been minimized.

@fregante
Copy link
Owner Author

fregante commented Apr 25, 2020

Users can already run these, however accessing the right developer tools can be tricky. Also these instructions only work if the extension loads webextensions-polyfill

Export

  1. Open the extension’s options
  2. Open the developer tools for the extension’s iframe only
  3. Run this
    copy('browser.storage.sync.set(' + JSON.stringify(await browser.storage.sync.get('options')) + ')')
    It will copy a full pastable command to import the options

Import

  1. Open the extension’s options
  2. Open the developer tools for the extension’s iframe only
  3. Paste what you copied and run it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants