tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_webconsole_non_javascript_mime_warning.js (802B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 // Tests that <script> loads with non-JavaScript MIME types produce a warning.
      5 // See Bug 1510223.
      6 
      7 "use strict";
      8 
      9 const TEST_URI =
     10  "https://example.com/browser/devtools/client/webconsole/" +
     11  "test/browser/" +
     12  "test-non-javascript-mime.html";
     13 const MIME_WARNING_MSG =
     14  "The script from “https://example.com/browser/devtools/client/webconsole/test/browser/test-non-javascript-mime.js” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type";
     15 
     16 add_task(async function () {
     17  const hud = await openNewTabAndConsole(TEST_URI);
     18  await waitFor(() => findWarningMessage(hud, MIME_WARNING_MSG), "", 100);
     19  ok(true, "MIME type warning displayed");
     20 });