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

Allow enabling CSS minifier for improved privacy #362

Closed
h-h-h-h opened this issue Mar 9, 2018 · 2 comments
Closed

Allow enabling CSS minifier for improved privacy #362

h-h-h-h opened this issue Mar 9, 2018 · 2 comments

Comments

@h-h-h-h
Copy link

h-h-h-h commented Mar 9, 2018

I use Stylus in Firefox on Windows 10.

When I check the DOM with the developer tools, I see, Stylus embeds my original style text into it:

<style id="stylus-2" type="text/css" class="stylus">
/* My brilliant style revealing business secrets. */
...
</style>

Similar to other types of fingerprinting, 3rd parties can send the innerHTML back to the server and inspect your original CSS text.

It would obviously be best to style a webpage without providing the CSS text to 3rd parties. Because it is not done this way, I suspect, it's impossible.

To improve the situation, there could be an option to enable minifying the CSS, thus striping out all comments.

Here's a benchmark of different CSS minifiers written in JavaScript. CSSO and Crass are the fastest.


At the very least, there should be a note, that others may get hold of your CSS text by sending it from the webpage back to the server.

@tophf
Copy link
Member

tophf commented Mar 9, 2018

We can strip the comments, but it's really weird to put business secrets there so I'm not sure we should add this feature even as an option. There are almost always weird ways to shoot yourself in the leg, but that doesn't mean we should account for all of that.

We'll switch to tabs.insertCSS in the future (see #248) which makes the styles totally inaccessible from the web page.

@h-h-h-h
Copy link
Author

h-h-h-h commented Mar 9, 2018

That's great! Thanks.

I guess, we can close this issue, then.

@h-h-h-h h-h-h-h closed this as completed Mar 11, 2018
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