Source Viewer

View Page Source of any Website.

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

  1. // ==UserScript==
  2. // @version 6.7.2.4
  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. // @namespace https://greasyfork.org/users/4792
  10. // @supportURL https://greasyfork.org/scripts/4611/feedback
  11. // @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
  12. // @noframes
  13. // @compatible Chrome tested with Tampermonkey
  14. // @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
  15. // @contributionAmount €1.00
  16. // @grant GM_registerMenuCommand
  17. // @include *
  18. // ==/UserScript==
  19.  
  20. GM_registerMenuCommand("view-source:"+window.location, function () {
  21. var source = "<html>";
  22. source += document.getElementsByTagName('html')[0].innerHTML;
  23. source += "</html>";
  24. source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
  25. source = "<pre>" + source + "</pre>";
  26. var sourceWindow = window.open();
  27. sourceWindow.document.write(source);
  28. sourceWindow.document.close();
  29. if (window.focus) sourceWindow.focus();
  30. });
  31. // ==============