Source Viewer

View Page Source of any Website.

当前为 2020-10-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @version 6.7.2.3
  3. // @name Source Viewer
  4. // @name:de Seitenquelltext anzeiger
  5. // @description View Page Source of any Website.
  6. // @description:de Schauen Sie sich den Seitenquelltext von jeder beliebigen Website an.
  7. // @author wack.3gp
  8. // @copyright 2019+ , wack.3gp (https://greasyfork.org/users/4792)
  9. // @grant unsafeWindow
  10. // @grant GM_registerMenuCommand
  11. // @noframes
  12. // @include *
  13. // @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
  14. // @namespace https://greasyfork.org/users/4792
  15. // @supportURL https://greasyfork.org/scripts/4611/feedback
  16. // @compatible Chrome tested with Tampermonkey
  17. // @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
  18. // @contributionAmount €1.00
  19. // ==/UserScript==
  20.  
  21. GM_registerMenuCommand("view-source:"+window.location, function () {
  22. var source = "<html>";
  23. source += document.getElementsByTagName('html')[0].innerHTML;
  24. source += "</html>";
  25. source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
  26. source = "<pre>" + source + "</pre>";
  27. var sourceWindow = window.open();
  28. sourceWindow.document.write(source);
  29. sourceWindow.document.close();
  30. if (window.focus) sourceWindow.focus();
  31. });
  32. // ==============