You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reader mode on Royal Road stories shows CSS-hidden messages #984
Somewhere in the page, buried in the chapter, you'll see a message like "If you come across this story on Amazon, it's taken without permission from the author. Report it." or "Help support creative writers by finding and reading their stories on the original site." or similar. There are various rotating messages. In that example URL, it appears right after the text "No response".
Royal Road embeds these messages in stories to fool simplistic scrapers. They all have CSS classes (with randomly generated class names) that are styled with a style element like this:
This isn't really fixable in readability the way it is currently designed.
This doesn't require loading a separate CSS file; the styling is on the same HTML page.
This seems to be based on a misunderstanding of the constraints of readability - the problem isn't so much the external resource fetching (although tbf that doesn't help), but also the fact that we don't have a CSS parser and a layout engine, so determining which styles apply isn't possible (would require a full CSSOM etc.). Even in jsdom the "cascade" part of CSS is not fully implemented, cf. jsdom/jsdom#2690 - never mind the humble JSDOMParser that gets used in Firefox.
So unless we change the fundamental approach of readability (and rely on a layout engine and getComputedStyle etc. working correctly), I don't think this is fixable at the moment.
Activity
gijsk commentedon Sep 24, 2025
This isn't really fixable in readability the way it is currently designed.
This seems to be based on a misunderstanding of the constraints of readability - the problem isn't so much the external resource fetching (although tbf that doesn't help), but also the fact that we don't have a CSS parser and a layout engine, so determining which styles apply isn't possible (would require a full CSSOM etc.). Even in
jsdomthe "cascade" part of CSS is not fully implemented, cf. jsdom/jsdom#2690 - never mind the humbleJSDOMParserthat gets used in Firefox.So unless we change the fundamental approach of readability (and rely on a layout engine and
getComputedStyleetc. working correctly), I don't think this is fixable at the moment.