Source Viewer

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

Fra 01.05.2024. Se den seneste versjonen.

// ==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://gf.zukizuki.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);