GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.32k stars 9.36k forks source link

[BUG] Does not provide fallback content when JavaScript is not available #5563

Closed ghost closed 6 years ago

ghost commented 6 years ago

Bug report

Provide the steps to reproduce

  1. Run LH on

What is the current behavior?

If I use this code (example code):

<noscript>
    <iframe src="noscript.html" frameborder="0" style="height: 100%; width: 100%;"></iframe>
    <noframes>You maybe have disabled JavaScript and Frames, please enable JavaScript or frames in You browser. More info: <br>
        <a href="http://tutorial.com/how-to-enable-js">How to enable JavaScript</a> <br>
        <a href="http://tutorial.com/how-to-enable-frames">How to enable frames</a>
    </noframes>
</noscript>

screenshot_192

What is the expected behavior?

do not report warning

Environment Information

V8 6.7.288.46 Related issues

patrickhulce commented 6 years ago

I suppose it's arguable if an iframe is sufficient content when script is not enabled. Traversing the entire frame tree to find text is a lot of complexity to add for a minimally useful audit.

Aside: curious why not just redirect to the noscript page if the iframe is the only intended content?

ghost commented 6 years ago

that code was only for example,... but I think, it does not report warning when someone use code similiar to that in example. Maybe lighthouse need only look if noscript tag is in webpage, and if it isn't empty.

sekisanchi commented 6 years ago

Phishtank needs this improvement, I guess.

patrickhulce commented 6 years ago

Maybe lighthouse need only look if noscript tag is in webpage, and if it isn't empty.

That's a good idea 👍 the only point of the audit is to force the developer to consider the noscript case :)