test-bug-762593-insecure-passwords-about-blank-web-console-warning.html 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf8">
  5. <title>Bug 762593 - Add warning/error Message to Web Console when the
  6. page includes Insecure Password fields</title>
  7. <!-- Any copyright is dedicated to the Public Domain.
  8. http://creativecommons.org/publicdomain/zero/1.0/ -->
  9. <!-- This test tests the scenario where a javascript adds password fields to
  10. an about:blank iframe inside an insecure web page. It ensures that
  11. insecure password fields like those are detected and a warning is sent to
  12. the web console. -->
  13. </head>
  14. <body>
  15. <p>This insecure page is served with an about:blank iframe. A script then adds a
  16. password field to it.</p>
  17. <iframe id = "myiframe" width = "300" height="300" >
  18. </iframe>
  19. <script>
  20. var doc = window.document;
  21. var myIframe = doc.getElementById("myiframe");
  22. myIframe.contentDocument.open();
  23. myIframe.contentDocument.write("<form><input type = 'password' name='pwd' value='test'> </form>");
  24. myIframe.contentDocument.close();
  25. </script>
  26. </body>
  27. </html>