Spacehey Profile Style Stripper

Remove all custom styles from profile with a button click.

目前为 2024-08-17 提交的版本。查看 最新版本

// ==UserScript==
// @name         Spacehey Profile Style Stripper
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Remove all custom styles from profile with a button click.
// @author       sudofry
// @match        https://spacehey.com/*
// @exclude      https://spacehey.com/home
// @exclude      https://spacehey.com/browse*
// @exclude      https://spacehey.com/search*
// @exclude      https://spacehey.com/bulletin*
// @exclude      https://spacehey.com/bulletins*
// @exclude      https://spacehey.com/favorites*
// @exclude      https://spacehey.com/invite*
// @exclude      https://spacehey.com/mobile*
// @exclude      https://spacehey.com/about*
// @exclude      https://spacehey.com/edit*
// @exclude      https://spacehey.com/createbulletin*
// @exclude      https://spacehey.com/addbulletincomment*
// @exclude      https://spacehey.com/friends*
// @exclude      https://spacehey.com/help*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=spacehey.com
// @grant        none
// @require      https://code.jquery.com/jquery-3.7.0.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var $ = window.jQuery;
    var css = document.createElement("style");
    css.innerHTML = `

    #divMain {
        width:auto;
        height:auto;
    }

    #removeStyle {
        position: fixed;
        top: 20px;
        right: 20px;
        background-color: #99ffcc;
        border: 1px solid #343536;
        border-radius: 12px;
        width: 23px;
        height: 23px;
        z-index: 1000;
    }`;

    document.head.appendChild(css);

    var divMain = document.createElement("div");
    divMain.id = "divMain";
    $("body").append(divMain);

    var removeStyle = document.createElement("span");
    removeStyle.id = "removeStyle";
    $("#divMain").append(removeStyle);

    $("#removeStyle").on("click", function(e) {
        e.preventDefault();
        $("#divMain").remove();
        $('link[rel="stylesheet"], style').remove();
        $('*').removeAttr('style');
        $('head').append('<link rel="stylesheet" type="text/css" \ href="https://spacehey.com/css/normalize.css" />');
        $('head').append('<link rel="stylesheet" type="text/css" \ href="https://spacehey.com/css/my.css?c=611092df99e4404d30746415f0d5f410c6cfd8bcb8c9a4a52e0fefb7b673b213" />');
    });

})();