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

Another way to auto-update the stylesheet #8

Open
zhaofengli opened this issue Feb 13, 2015 · 10 comments
Open

Another way to auto-update the stylesheet #8

zhaofengli opened this issue Feb 13, 2015 · 10 comments

Comments

@zhaofengli
Copy link

Hello, Andrew. There's a better way to have users' stylesheets updated without using any browser add-ons, in case if you are not aware. You can create a central stylesheet under your userspace so that users can use it in two ways:

  • Add this to their own custom CSS pages: @import url("https://en.wikipedia.org/w/index.php?title=User:Your_Username_Here/WiTeX.css&action=raw&ctype=text/css");
  • Add this to their own custom JS pages: importStylesheet("User:Your Username Here/WiTeX.css"); (This requires JavaScript support)

P.S. Your stylesheet is being discussed at Administrators' noticeboard as multiple editors are worried about potential abuse. Your input is appreciated and can clear out confusion. Thank you.

Zhaofeng Li (User:Zhaofeng Li on Wikipedia)

@zhaofengli
Copy link
Author

Another way is to serve the stylesheets with GitHub Pages, which sends the correct Content-Type (text/css). This may violate the privacy policy I'm afraid.

@AndrewBelt
Copy link
Owner

Thanks for the notice.
The following works for me when I paste it into my vector.css stylesheet.

@import url("//cdn.rawgit.com/AndrewBelt/WiTeX/master/style.css");

It updates from the master branch of this repo, and it caches once loaded from rawgit.com and is not loaded from Wikipedia's servers, so it's a win-win.
I'll clear up some confusion on the noticeboard before I push that change to the README.

@zhaofengli
Copy link
Author

Looks like it doesn't work that way... From rawgit.com: "Files are cached permanently after the first request." And on-wiki elements should not depend on third-party servers, or there may be some problems with the privacy policy.

@AndrewBelt
Copy link
Owner

It looks like you're right about the caching. I'll try your recommendation of Github Pages.

I'm not sure I understand the privacy policy point. The WiTeX stylesheet already loads fonts from a separate domain, so loading the stylesheet itself from another domain wouldn't void parts of the PP any more than it already is.

@AndrewBelt
Copy link
Owner

I should note that hosting a "master copy" of the stylesheet on Wikipedia allows users to change everyone's stylesheet at the same, and I'm not sure of the security issues of doing this. Is it possible to lock one's Vector.css stylesheet from editing?

@zhaofengli
Copy link
Author

I've left a note on the noticeboard about the privacy policy. Maybe someone from WMF can answer that? Aside from administrators and interface editors, you are the only one who can edit the *.css and *.js subpages in your userspace (Or everyone will start injecting fun stuff into others' script pages).

@AndrewBelt
Copy link
Owner

Okay, I'll opt for your original idea then. It seems to work across Wikipedia languages as well. I've created a new Wikipedia account for this purpose. Here's the final code.

@import url("https://en.wikipedia.org/w/index.php?title=User:AndrewBelt/WiTeX.css&action=raw&ctype=text/css");

@zhaofengli
Copy link
Author

Um, looks good, but I'm still a little bit concerned about the privacy issue. We have Tool Labs which provides free hosting for tools "that help users maintain and use wikis", so your stylesheet may fall into its scope. The logs there are redacted in order to play nice with the privacy policy. I'd appreciate if you restore the "edit" link besides the headings in a non-obtrusive way, so that users are able to fix problems they encounter. By the way, I just love the minimalistic design when reading. Maybe I can make a script to switch to the "Reader view" and back later.

@AndrewBelt
Copy link
Owner

I've opened #9 to handle the edit link.

A thought experiment: What's the difference according to MediaWiki's privacy policy between someone pasting

body{background: url("a cool picture I found on the internet.com");}

and users pasting the WiTeX script? And what's the difference between users pasting the script itself and a link to the script, either hosted at en.wikipedia.org or github.io?

My intuition is that all share one feature, that the user inserting third party code cannot expect the relevant parts of MediaWiki's privacy policy to hold, as would be true for all websites with a privacy policy.

@zhaofengli
Copy link
Author

Very true. They are exactly of the same nature, and in my opinion render the privacy policy meaningless. Although users should take their privacy into consideration when installing such scripts, we can make them feel safe by conforming to the policy. Maybe I can help you set up a tool on Tool Labs that serves all the fonts?

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

No branches or pull requests

2 participants