Skip to content

Instantly share code, notes, and snippets.

@scootcho
Forked from krishpop/export-toby.js
Created April 18, 2020 02:33
Show Gist options
  • Save scootcho/a01ac6ced58e0a7ea530537ea6c2c175 to your computer and use it in GitHub Desktop.
Save scootcho/a01ac6ced58e0a7ea530537ea6c2c175 to your computer and use it in GitHub Desktop.
Export Toby
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment