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

Sync styles #2

Open
JasonBarnabe opened this issue Sep 12, 2013 · 60 comments
Open

Sync styles #2

JasonBarnabe opened this issue Sep 12, 2013 · 60 comments

Comments

@JasonBarnabe
Copy link
Contributor

From stylish-userstyles/stylish#94

http://forum.userstyles.org/discussion/33477/sync-userstyles-between-chrome-instances#Item_4

@etodd
Copy link

etodd commented Oct 29, 2013

+1

4 similar comments
@ivysrono
Copy link

+1

@danijar
Copy link

danijar commented Jan 15, 2015

+1

@stasleo
Copy link

stasleo commented Jan 25, 2015

+1

@Baegus
Copy link
Contributor

Baegus commented Jan 26, 2015

+1

JasonBarnabe pushed a commit that referenced this issue Feb 19, 2015
@tophf
Copy link
Contributor

tophf commented Mar 12, 2015

Seems easy. @hideheader, what do you say?
100kB overall sync data limit with max 8kB/item might be too small for many styles, so we'll have to use some zip lib.

@PushkaCom
Copy link

Since this is Chrome sync - and the user needs to be logged into a Google account to sync Chrome - couldn't the extension access the user's Google Drive storage to place settings data in there? or can Chrome extensions not ask the user for permission? or Stylish doesn't want to branch out too much just for the chrome version?

@tophf
Copy link
Contributor

tophf commented Mar 18, 2015

@PushkaCom, that would look verrrry strange. Are there any extensions or addons that use it instead of the browser's built-in sync abilities?

@AKPWebDesign
Copy link

Instead of syncing the styles themselves, is it possible to sync URLs to access the styles?

@PxlBuzzard
Copy link

@AKPWebDesign That wouldn't sync styles created locally, but it's a good idea. Any thoughts on how to handle local?

@AKPWebDesign
Copy link

Perhaps a GitHub Gist could be used. When the local style is ready to be synced, create a Gist, and use the direct URL. And to save more space, you could even shorten the URLs with goo.gl or something similar.

@PxlBuzzard
Copy link

That's not a small feature request or a great user experience. You would have to create a private gist (it is a local stylesheet after all, the assumption would be to maintain privacy) which would require people setting up a new personal access token, saving a new gist, and saving that gist ID along with their token into Stylish.

I still think saving a list of links is a good idea on the surface, but whatever the outcome it should be a simple solution for both developers to create/maintain/debug and users to use.

@AKPWebDesign
Copy link

You don't need to create a personal access token. Saving a new gist is as simple as a POST request to https://api.github.com/gists with the proper data, and the gists created are private by default.

I'm currently using gists for some features in a Node.JS program, and can provide example code, if it would help.

@marlun
Copy link

marlun commented Apr 10, 2015

Would be nice to have som statistics on how much styles people have. Maybe the default sync storage is enough for most users and only power users need more where a more advanced (complex) feature could be added?

@michaelmior
Copy link

If a first version of this feature only synced the URLs to public styles, I think that would still be a welcome addition and not too complex to implement. Some solution for private styles could be bolted on later.

@marlun
Copy link

marlun commented Apr 11, 2015

I only use private styles since I use Stylus to make a couple of sites I use more readable by changing the font to what I like but I guess I could publish them to be able to sync them.

@digitalfiz
Copy link

I second using Drive for the sync. A few apps do this already. No reason one more can't. Could even make it save them as plain css files so they can be edited in drive with a normal editor :P

@marlun
Copy link

marlun commented May 11, 2015

I'm not sure if this has been brought up somewhere else (tried to search) or if it's not possible, but what about the possibility to provide a path where the styles are loaded from and saved to? That would let you handle the syncing yourself with something like Bittorrent Sync/Dropbox?

@tophf
Copy link
Contributor

tophf commented May 12, 2015

So:

  • Built-in Chrome sync: chrome.storage API using LZMA-JS compressor in order not to exceed strict sync quotas: 100kB for everything which roughly corresponds to 500kB of uncompressed text (or considerably less if lots of base64-encoded images are used).

    Your extension's content scripts can directly access user data without the need for a background page.

    Great! Stylish could apply styles immediately on Chrome startup when it starts with previously opened pages, whereas currently the original unstyled page is shown for 1-3 seconds.

  • Text-based: a textarea with import/export using JSON format to get/update/replace the entire list of styles

  • Drag'n'drop CSS files onto Manage styles page to install/update them

  • Connect to Drive/Dropbox/... account - afaik it doesn't require any passwords, just be logged on to the service and confirm app access. Implementation-wise it might require registering an application ID for Stylish.

  • webkitPersistentStorage:

    • stays in the browser unless the app or the user removes it, but the user must grant you permission before you can use it. In contrast, temporary storage is automatically granted without any user permission, but it can be expunged by the browser at any time.
    • stored under <Chrome profile directory>/File System
    • file and dir names are obfuscated (but content in files is unchanged).

    So just add this folder to dropbox/drive/whatever or symlink/ntfs-junction it into the sync folder.

  • Full filesystem access. This requires a permission in manifest so when users install the extension some/many of them might think twice whether to allow the extension FULL ACCESS TO YOUR LOCAL FILE SYSTEM... While it's expected for download managers but I doubt it's okay for Stylish.

@tophf tophf mentioned this issue Jul 28, 2015
@ghost
Copy link

ghost commented Jul 29, 2015

Any news on this?

@LouCypher
Copy link
Contributor

@tophf wrote:

  • Text-based: a textarea with import/export using JSON format to get/update/replace the entire list of styles

I prefer this one.

@ghost
Copy link

ghost commented Jul 30, 2015

Can you at least create an option to dump json(sql)/import dump back?

@tophf
Copy link
Contributor

tophf commented Jul 31, 2015

Yes, we can!

@ghost
Copy link

ghost commented Jul 31, 2015

@tophf thanks a lot!

@sobh
Copy link

sobh commented Aug 24, 2015

The chrome.storage option seem like the most elegant solution. As for the 100KB quota limit:

  • The average user might not even need half of it.
  • Power users could upload their styles to userstyles.org and just sync the URL.

@AKPWebDesign
There are some problems with Gists:

  • Gists aren't private (including Secret Gists).
  • Need a GitHub account.
  • Anonymous Gists are kind of immutable, thus not suitable for syncing.

@ryanbuening
Copy link

+1

@PushkaCom
Copy link

Note that if you use a website like greasy fork to host styles, you can use tampermonkey for chrome to sync styles ~

@cmei84
Copy link

cmei84 commented Feb 15, 2016

+1

@danijar
Copy link

danijar commented Feb 28, 2016

Manual export/import really is no solution to this problem since users would have to go through the process of copy/upload/download/paste on every small change.

Personally, I'd be okay with Drive sync if I can define the folder containing the styles. But I can also see that it would be a large investment for users who are not using Google Drive already. Also, I think it is more work than using gists.

As long as Github is cool with that, I don't see a problem creating a new secret gist on every change. Also, I agree with @sobh and @Nojevah on the size limit of Chrome settings not being a problem for most of the users.

@lichtscheu
Copy link

Any new on this?

@Splike
Copy link

Splike commented May 2, 2016

+1

@smiller171
Copy link

Guys, there are built in reactions now. Please don't leave a +1 comment with nothing else to add.

@danijar
Copy link

danijar commented May 3, 2016

@PushkaCom Do you know how Tampermonkey syncs scripts?

@ivysrono
Copy link

ivysrono commented May 3, 2016

ViolentMonkey can auto sync scripts by onedrive/dropbox, even between chrome and opera.

@danijar
Copy link

danijar commented May 3, 2016

@renyouguo I'd prefer Chrome sync because it doesn't force users to use one of a set of supported cloud storages. For me, Google Drive would be fine but for someone else it would be Dropbox or nothing at all. Even though cross-browser sync is quite cool indeed.

@Slivo-fr
Copy link

+1

@leotm
Copy link

leotm commented Jul 29, 2016

ib4 3-yr anniversary.
+1

@sourcedelica
Copy link

One drawback with using cloud storage is that a lot of companies (like the one I work for now) block them. The native Chrome sync would be the best in that regard.

@festum
Copy link

festum commented Aug 22, 2016

+1

@smiller171
Copy link

smiller171 commented Aug 22, 2016

Seriously...this issue has been open for nearly 3 years and has more comments and thumbs up than any other issue in your backlog, open or closed. Please throw us a bone here @JasonBarnabe

@tophf
Copy link
Contributor

tophf commented Aug 22, 2016

Jason Barnabe doesn't use sync, and evidently, obviously not interested in implementing it. As for me, I don't use sync as well. The only reason I've contributed is to have the features I needed, mostly UI-related, a couple of performance enhancements. Actually, this was the only reason I've learnt programming many years ago in the first place: to be able to modify/enhance the apps I use. So my point (and obviously Jason's) is that anyone is free to [learn programming and] implement sync functionality.

@fiatjaf
Copy link

fiatjaf commented Aug 22, 2016

This is a complex feature. I think some people may be afraid that if they implement it in the way they think they should @JasonBarnabe will not accept their PR. I know I do that. Perhaps Jason could just delineate how he would like the feature to be implemented people would take a second look at the idea of implementing it.

@w1ndy
Copy link

w1ndy commented Dec 28, 2016

It has been 3 years and the sync feature is still missing? Could we implement a basic version first, like sync small stylesheets directly but ignore large ones? I believe it would benefit many users.

@coman4
Copy link

coman4 commented Dec 28, 2016

+1

1 similar comment
@hell-racer
Copy link

+1

@austin-guevara
Copy link

Anything new on this? 😄

@TheGamesmenDev
Copy link

TheGamesmenDev commented Sep 4, 2017

proposed solution: #205

@Nojevah
Copy link

Nojevah commented Sep 4, 2017

Still not worth uBlock/uMatrix sync system.

@lichtscheu
Copy link

i am crazy? does stylish now support sync by default? installed new chrome version and opened a site at work where i have a style active only on my machine at home, but the style was there, opened stylish and there are many styles i absolutley did not install at work?

@jlous
Copy link

jlous commented Dec 13, 2017

Were those your own local styles or referenced ones?

@jlous
Copy link

jlous commented Dec 13, 2017

Tamper Monkey provides a choice between browser sync and google drive

@livejamie
Copy link

Commenting in 2018, would still love this

@jareddyck
Copy link

Yeah would love to have this feature...

@leotm
Copy link

leotm commented Sep 25, 2018

I'm guessing it no longer matters since Google pulled out Stylish from the Chrome Web Store.

@livejamie
Copy link

I'm guessing it no longer matters since Google pulled out Stylish from the Chrome Web Store.

I switched to Stylus

@jkupczak
Copy link

Happy 2022 everyone.

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

No branches or pull requests