Source Viewer

View the HTML source code of any online web page. (use the Tampermonkey Command Menu)

当前为 2024-05-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Source Viewer
  3. // @name:de Seitenquelltext anzeigen
  4. // @description View the HTML source code of any online web page. (use the Tampermonkey Command Menu)
  5. // @description:de Schauen Sie sich den Seitenquelltext von jeder beliebigen Website an.
  6. // @version 6.7.3.7
  7. // @icon https://translate.google.com/favicon.ico
  8. // @author JAS1998
  9. // @copyright 2023+ , JAS1998
  10. // @namespace https://greasyfork.org/users/4792
  11. // @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
  12. // @compatible Chrome tested with Tampermonkey
  13. // @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
  14. // @run-at document-end
  15. // @match *://*/*
  16. // @grant GM_registerMenuCommand
  17. // @grant GM_notification
  18. // ==/UserScript==
  19.  
  20. /* jshint esversion: 9 */
  21.  
  22. function donate() {
  23. alert("Hello, I'm JAS1998\nand i wrote this script as a hobby\nYou have been using this script for some time, if you find it useful, i would appreciate a small donation! =)");
  24. window.location="https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8";
  25. }
  26.  
  27. function viewSource() {
  28. if (GM_info.script.copyright.includes(GM_info.script.namespace)) {
  29. var source = "<html>";
  30. source += document.getElementsByTagName('html')[0].innerHTML;
  31. source += "</html>";
  32. source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
  33. source = "<pre>" + source + "</pre>";
  34. var sourceWindow = window.open();
  35. sourceWindow.document.write(source);
  36. sourceWindow.document.close();
  37. if (window.focus) sourceWindow.focus();
  38. } else {
  39. alert("Please install the Orginal Version");
  40. location.href = GM_info.script.supportURL.replace("feedback", "");
  41. }
  42. }
  43.  
  44. GM_registerMenuCommand("Donate now 🎁", donate);
  45. GM_registerMenuCommand("view-source:" + window.location, viewSource);