Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Modify the look of the Safari 5 Reader function' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Modify the look of the Safari 5 Reader function
Authored by: diamondsw on Jun 09, '10 08:01:19AM

Of course, modifying any files inside the application package will invalidate the application signature and affect Safari's use of the keychain. This is best addressed via the new extension mechanism.

I don't suppose it's possible for a user CSS file to override the Reader CSS design, is it?



[ Reply to This | # ]
Modify the look of the Safari 5 Reader function
Authored by: leamanc on Jun 09, '10 12:15:35PM

I would think it would be possible. I might give it a try later and see what happens.

If anyone else has tried a user stylesheet and got it to affect Reader, please post here!

EDIT: I just tried it, by copying and pasting the replacement css in a small file and added it to Safari 5 as a user stylesheet. It did not make the changes in Reader.

Edited on Jun 09, '10 12:18:53PM by leamanc



[ Reply to This | # ]
Modify the look of the Safari 5 Reader function
Authored by: TF on Jun 09, '10 04:03:03PM

Is this the case? Does editing this CSS file screw up Keychain access? Can someone please confirm this? i really want to try this hint but don't want to mess with Safari's signature.



[ Reply to This | # ]
Modify the look of the Safari 5 Reader function
Authored by: squareman on Jun 09, '10 10:09:38PM

Perfectly easy to override the style in the reader using a user style sheet. No need to hack into application bundle (because that will get overridden with Safari updates).

The trick is getting a higher specificity score than what's in the reader's stylesheet. For example. I wrote a simple "reader.css" file to point at with Safari's advanced settings in prefs (Advanced > Style Sheet). They style in question to override in reader's style sheet is ".page" (worth "0,0,10,0" in specificity), So I simply need to write a style for "html .page" and that will have higher specificity (0,0,10,1). I tried it and it worked flawlessly and I was able to do it without even restarting or quitting Safari. Here was the style I used:

html .page { text-align: inherit; }

[ Reply to This | # ]
Modify the look of the Safari 5 Reader function
Authored by: squareman on Jun 09, '10 11:22:07PM

Okay, I replied earlier about user style sheets, but my comment in stuck in moderation. I was wrong. You cannot use the user stylesheet to override the style (even if you pull out the draconian !important).



[ Reply to This | # ]
Inline CSS Styles
Authored by: rbrtrx on Jun 10, '10 04:45:58AM

Doing some inspection shows that Reader’s CSS styling is actually applied as inline styles, presumably copied from the CSS file in the app bundle. Therefore, changing that CSS file changes what ends up in Reader, but user stylesheets won’t since inline styles have priority (even with the dread !important) over user stylesheets.

Incidentally, this also prevents a) Reader’s CSS from affecting the loaded page, and b) the loaded page’s CSS from affecting Reader. It was pretty nearly necessary for them to do it this way if they wanted to keep Reader as HTML/CSS within the same web view (and apparently they did).

A Safari extension might have more luck, as it ought to be able to alter the inline styles directly. We shall see.



[ Reply to This | # ]
Modify the look of the Safari 5 Reader function
Authored by: rbrtrx on Jun 10, '10 05:26:26AM

Sadly, it looks like extensions aren’t loaded into safari-resource URLs (which is apparently what Safari is using to load the Reader sources). IIRC file URLs are treated the same way.

I suppose we should file a bug on this.



[ Reply to This | # ]