axe-firefox-devtools icon indicating copy to clipboard operation
axe-firefox-devtools copied to clipboard

Inserted script makes HTML invalid

Open jkshapiro opened this issue 7 years ago • 0 comments

Steps to reproduce:

  1. In Firefox on Windows, with Axe installed, visit a web site, e.g. Google, https://www.google.com/
  2. Open the Inspector (ctrl-shift-C).

Expected:

  • <head> is the first child of <html>.

Observed:

  • The following code is inserted between <html> and <head>:
<script>
    // This signals the axe-core test suite that the extension is running.
    window.__AXE_EXTENSION__ = true
  </script><script>
    // This signals the axe-core test suite that the extension is running.
    window.__AXE_EXTENSION__ = true
  </script><script>
    // This signals the axe-core test suite that the extension is running.
    window.__AXE_EXTENSION__ = true
  </script><script src="https://apis.google.com/_/scs/abc-static/_/js/k=gapi.gapi.en.7_zYrcOKhe0.O/m=gapi_iframes,googleapis_client,iframes_styles_slide_menu,plusone/rt=j/sv=1/d=1/ed=1/rs=AHpOoo_tirFeAub0r3Y1DFynYgUbfJZWLA/cb=gapi.loaded_0" nonce="fO6xzUSFLDZAUJZZ3vPJqQ==" async=""></script><script>
    // This signals the axe-core test suite that the extension is running.
    window.__AXE_EXTENSION__ = true
  </script>

Besides being a bit repetitive, this is invalid HTML (see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html): the only permitted content for an <html> element is one <head> element followed by one <body> element.

jkshapiro avatar Oct 04 '18 14:10 jkshapiro