Source Viewer

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

Från och med 2024-05-01. Se den senaste versionen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name Source Viewer
// @name:de Seitenquelltext anzeigen
// @description View the HTML source code of any online web page. (use the Tampermonkey Command Menu)
// @description:de Schauen Sie sich den Seitenquelltext von jeder beliebigen Website an.
// @version 6.7.3.7
// @icon https://translate.google.com/favicon.ico
// @author JAS1998
// @copyright 2023+ , JAS1998
// @namespace https://greasyfork.org/users/4792
// @license CC BY-NC-ND 4.0; http://creativecommons.org/licenses/by-nc-nd/4.0/
// @compatible Chrome tested with Tampermonkey
// @contributionURL https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8
// @run-at document-end
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_notification
// ==/UserScript==

/* jshint esversion: 9 */

function donate() {
    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! =)");
    window.location="https://www.paypal.com/donate?hosted_button_id=9JEGCDFJJHWU8";
}

function viewSource() {
    if (GM_info.script.copyright.includes(GM_info.script.namespace)) {
        var source = "<html>";
        source += document.getElementsByTagName('html')[0].innerHTML;
        source += "</html>";
        source = source.replace(/</g, "&lt;").replace(/>/g, "&gt;");
        source = "<pre>" + source + "</pre>";
        var sourceWindow = window.open();
        sourceWindow.document.write(source);
        sourceWindow.document.close();
        if (window.focus) sourceWindow.focus();
    } else {
        alert("Please install the Orginal Version");
        location.href = GM_info.script.supportURL.replace("feedback", "");
    }
}

GM_registerMenuCommand("Donate now 🎁", donate);
GM_registerMenuCommand("view-source:" + window.location, viewSource);