uriloader/exthandler/tests/mochitest/test_web_protocol_handlers.html
author Syeda Asra Arshia Qadri <asra.qadri@gmail.com>
Thu, 14 Mar 2019 11:19:44 +0000
changeset 521883 9e322c3c5db7941730308e3022222a8904081b99
parent 521860 14c61ee043c8e0507c05e13b8c82a0610df660fa
child 528457 c9c0c6f2eed54a187e124942e53c3660b4cf17d8
permissions -rw-r--r--
Bug 1532941 - Enable ESLint for uriloader (automatic changes). r=Standard8,qdot Differential Revision: https://phabricator.services.mozilla.com/D22308

<!DOCTYPE html>
<html>
<head>
  <title>Test for disabled registerProtocolHandler</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<iframe id="test"></iframe>
<script type="text/javascript">
add_task(async function() {
  await SpecialPowers.pushPrefEnv({
    set: [
      ["dom.registerContentHandler.enabled", true],
      ["dom.registerProtocolHandler.insecure.enabled", false],
    ],
  });

  let result = "registerProtocolHandler" in navigator;
  ok(!result, "Insecure registerProtocolHandler is undefined");
});
</script>
</body>
</html>