Visitar URL original
<input> still hidden if inside <noscript> · Issue #6 · meetDeveloper/JavaScript-Switcher · GitHub
Skip to content

<input> still hidden if inside <noscript> #6

Description

@goozak

Given this HTML:

<html>
  <head>
    <title>Working...</title>
  </head>
  <body>
    <form method="POST" name="hiddenform" action="http://dummy">
      <input type="hidden" name="Data" value="SomeData"/>
      <input type="hidden" name="OtherData" value="Coffee"/>
      <noscript>
        <p>Script is disabled. Click Submit to continue.</p>
        <input type="submit" value="Submit"/>
      </noscript>
    </form>
    <script language="javascript">window.setTimeout(alert('Submited via JS'), 0);</script>
  </body>
</html>

When JavaScript is disabled via the Switcher, the <p> tag is shown as expected, but not the <input>.
If JavaScript is disabled via javascript.enabled, the entire <noscript> is shown (but only if the Switcher is green).

Activity

  1. phil294 commented on Apr 17, 2022

    @phil294

    This bug is also prevalent with <style> elements which can break entire websites: Try opening a Startpage search with JS disabled by this addon: The results are invisible (!) because of missing noscript styles.

    I normally never recommend copying code, but in this case, I think it's best to just use 100% of uBlocks code for this logic, so replace background/content.js with https://github.com/gorhill/uBlock/blob/2b9aba27489274a42bcc03ae7ac1da3bb33305a9/src/js/scriptlets/noscript-spoof.js and it works fine. This uBlock version also considers xml files and meta refresh inside .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions