-
Notifications
You must be signed in to change notification settings - Fork 260
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
Storing user data to chrome.storage #93
Comments
Isn't possible to completely drop any local storage / chrome storage? It would be great to store settings in a simple file, or a database. I have many devices, phone/desktop and I am using multiple browsers Safari, FF, Chrome. Maybe somebody is good at server side languages, for simplicity like PHP and can help us. It can't be so hard to write/read settings to/from a file. 🤔 Yesterday I checked many startpages at /r/startpages and overall this was the best. 👍 |
This is almost what I am looking for. What do you think, it will be possible to read json from file? I mean automatically read (for example) settings.json from root directory? In this case I can export data, write manually to file (settings.json), but I don't need to import and store locally in local storage in every browser, since it will be automatically imported from settings.json. |
I think I understand what you want, but that kind of configuration is not user friendly for a browser extension. nightTab is primarily an extension and browsers users shouldn't need to edit files to use it. However if you want to host the files locally, as I think you are describing, you can directly edit the bookmarks.js file. This is read from the project on first load -- so not from local storage. |
Also, @hartk1213 has made an awesome tool which generates state.js and bookmark.js files from a JSON for scenarios like this. It could be what you're looking for: |
Very cool, this is what I am looking for, because I want to use as a standalone web app, instead of extension. |
Any updates on this? I spent two hours trying to edit the files directly with no luck, and the NightTabHelper is dated. It would be awesome if you could add an option for persistent storage outside of local storage for those of us who are privacy focused and automatically clear our caches. |
I am also joining the bandwagon for this possible feature as I am sure some of us will definitely want to host it locally. |
@orwells-ghost It should be possible to edit the bookmarks.js and state.js files and host the project with your preferred bookmarks. What specifically are you having trouble with? |
As it stands, I'm still investigating what I need to do to make this happen. nightTab is a side project and I don't devote all my free time to it. So I'm slowly reading up and learning about chrome.storage. |
Docs: Notes:
|
Thanks for quick reply nonetheless. I ended up editing two files mentioned earlier and hosting it as web page, but yeah it would be nice to be able to save/read a local config file if it's hosted as a web page. |
This startpage is by far the best I have ever seen. Unfortunately I have the same issue: Hosting it on a server with my edited bookmarks. I used gulp and built the project and I can use everything except saving across devices. Editing and compiling all these |
Just so I am clear, are you editing bookmarks.js and moving that to a different computer? Does the Export feature not work for you @AlfaJackal ? |
I have been developing more test projects using
Not good at all. |
String compression is 100% worth a look here. For example, there are multiple implementations of lz-string in pure Javascript. Using Dave Brown's compression algorithm got my config all the way down to function en(c){var x='charCodeAt',b,e={},f=c.split(""),d=[],a=f[0],g=256;for(b=1;b<f.length;b++)c=f[b],null!=e[a+c]?a+=c:(d.push(1<a.length?e[a]:a[x](0)),e[a+c]=g,g++,a=c);d.push(1<a.length?e[a]:a[x](0));for(b=0;b<d.length;b++)d[b]=String.fromCharCode(d[b]);return d.join("")}
function de(b){var a,e={},d=b.split(""),c=f=d[0],g=[c],h=o=256;for(b=1;b<d.length;b++)a=d[b].charCodeAt(0),a=h>a?d[b]:e[a]?e[a]:f+c,g.push(a),c=a.charAt(0),e[o]=f+c,o++,f=a;return g.join("")} The Source: Stack Overflow TLDR: Check out string compression with lz-string. Should reduce most configs below limit. |
But without string compression (mentioned above) or by creating some API (which costs $$); there isn't a way to do this afik |
Does the "unpin" operation mean this feature gonna release soon? |
I'm afraid not, it still seems like this feature request is too difficult to support (for reasons stated above). This issue was unpinned so that another ticket could gain focus. |
[> Docs: https://developer.chrome.com/extensions/storage https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync
The apis are now fully in sync. But Or implement UI for what items they want to sync. Still the default limit of 5 MB is pretty huge. And there's some native compressions already in play for synced data. |
Unfortunately we're constrained by feature parity so, like ZombieFox mentioned, its 100kb. (Chrome may have 5MB but if Firefox only has 100KB, we have to go with firefox's maximum as a universal max. An issue of the compression/decompression is that would likely result in a load time delay. |
Hi @zombieFox Have there yet been any successful attempts at syncing via Browser api sync? Possibly some other nice feature, if implementation via browser api is not possible, why not add a field where one can enter a link to a raw json file serving the config?, Nighttab then caches that locally and updates in the background. This would make it really easy, to just dump the config to any pastebin, github raw link, wastebin server etc. This way the url itself could be synced over via browser api. |
Investigate storing data to user account: https://developer.chrome.com/extensions/storage
Problems solving:
To investigate:
The text was updated successfully, but these errors were encountered: