Source Viewer

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

当前为 2021-03-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @version 6.7.3.1
  3. // @name Source Viewer
  4. // @name:de Seitenquelltext anzeigen
  5. // @description View the HTML source code of any online web page. (use the Tampermonkey Command Menu)
  6. // @description:de Schauen Sie sich den Seitenquelltext von jeder beliebigen Website an.
  7. // @author wack.3gp
  8. // @copyright 2019+ , wack.3gp (https://gf.qytechs.cn/users/4792)
  9. // @namespace https://gf.qytechs.cn/users/4792
  10. // @supportURL https://gf.qytechs.cn/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. // @resource meta https://gf.qytechs.cn/scripts/4611/code/meta.js
  17. // @grant GM_registerMenuCommand
  18. // @grant GM_notification
  19. // @grant GM_getResourceText
  20. // @include *
  21. // ==/UserScript==
  22.  
  23. /* jshint esversion: 9 */
  24.  
  25. if (GM_info.script.copyright.includes(GM_info.script.namespace)) {
  26. // nothing
  27. }
  28. else {
  29. location.href = GM_info.script.supportURL.replace("feedback", "");
  30. alert("Please install the Orginal Version");
  31. }
  32. // ===============
  33.  
  34. GM_registerMenuCommand("view-source:" + window.location, function () {
  35. if (GM_getResourceText("meta").indexOf(GM_info.script.version) > -1) {
  36. var source = "<html>";
  37. source += document.getElementsByTagName('html')[0].innerHTML;
  38. source += "</html>";
  39. source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
  40. source = "<pre>" + source + "</pre>";
  41. var sourceWindow = window.open();
  42. sourceWindow.document.write(source);
  43. sourceWindow.document.close();
  44. if (window.focus) sourceWindow.focus();
  45. }
  46. else {
  47. console.warn("Please download " + GM_getResourceText("meta").replace(/.*(?=v.*\d\D\d\D\d\D\d)/gims, '').split('/')[0] + GM_info.script.supportURL.replace("feedback", ""));
  48. GM_notification({
  49. title: "Update!",
  50. text: "Please download " + GM_getResourceText("meta").replace(/.*(?=v.*\d\D\d\D\d\D\d)/gims, '').split('/')[0],
  51. onclick: function () {
  52. location.href = GM_info.script.supportURL.replace("feedback", "");
  53. },
  54. });
  55. }
  56. });
  57. // ==============

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址