The discussion is about adding a get-option to enable a noscript view of a page on Discourse forums. rubo77 suggests adding a link to the read-only view at the bottom of the page, allowing users to print or translate the page without JavaScript enabled. A patch has been proposed to add a ?noscript parameter to achieve this, but it currently lacks a stylesheet.
rubro77 has made changes to the code, but the issue remains unsolved. codinghorror questions the need for a noscript view, suggesting users can change their browser’s user agent instead. However, rubo77 explains that the goal is to make sites like Google Translate work with Discourse without JavaScript.
Other users discuss the idea of an AMP (Accelerated Mobile Pages) view, but rubo77 clarifies that this is a separate issue. eviltrout mentions an existing parameter _escaped_fragment_ that can be used to get a crawlable version of the page, but rubo77 points out that this also lacks a stylesheet.
The discussion concludes with rubo77 suggesting that adding a “print-view” link with the ?noscript option would be a simple solution, requiring only two lines of code changes.
If you watch a discourse forum with javascript disabled, you get a read-only view of that page.
could you add a link to the read-only view at the bottom? so you can for example print the whole page or translate it with google,…
also a functioning noscript view of a search result should be easy to implement with this option. At the moment it doesn’t work without js like this: https://meta.discourse.org/search?q=something
def use_crawler_layout?
@use_crawler_layout ||= (has_escaped_fragment? || params.key?(:noscript) || CrawlerDetection.crawler?(request.user_agent))
end
And this seems to work, if I add ?noscript=1 to any site, I get the crawler-view, but the stylesheet is not included there, I guess there has to be changed somethhing in the layout too?
Isn’t a beefed up HTML view and AMP basically the same thing? What got me excited about AMP was that it seemed like a good specification for a beefed up Discourse HTML front-end to target.
It would be so easy, to just add a link aat the bottom: “print-view” that leads to adding the ?noscript option. I think only two lines of code have to be changed:
the one above and
one line (to be found) where the stylesheet will be included in case the option is set
does anybody understand the code, to tell this second lline? then the patch would be ready to be implemented
It seems broken in Chrome stable OS X 10.9.5. Choosing File, Print pops up the dialog for about a second then, before any interaction, it disappears and nothing is printed.
Seems to only affected me if I’m logged in. Opening an incognito window and trying to Print seems to work. Exact Chrome version is 46.0.2490.71 (64-bit).
[quote=“eviltrout, post:9, topic:33823, full:true”]
There is already a param for this: escaped_fragment – just add it to any URL to get the crawlable version.
[/quote]his doesn’t work anyway: