canto's profile picture

Published by

published

Category: Web, HTML, Tech

Remove Tacky Profile Styling

If someone's profile is getting to be a bit too.. much (e.g. mine [whoops]), you can use this script to clear their style tags.

 for(var i of document.getElementsByTagName("style")){
    i.innerHTML = "";
}


7 Kudos

Comments

Displaying 1 of 1 comments ( View all | Add Comment )

Gum Skyloard

Gum Skyloard's profile picture
Pinned

How do we apply that?


Report Comment



On most browsers, you should have a "developer console". (typically opened with the F12 key.) Navigate to it's console tab, and copy and paste the script in. Doing this on a user's profile will delete (on your end) all of their user-defined style tags. This will revert after refreshing the page.

An easier method of doing this would be to input it directly into the URL:
javascript:for(var i of document.getElementsByTagName("style")){i.innerHTML="";}
(You'll have to type the javascript: part yourself for security reasons.)

by canto; ; Report

Oooh!

Isn't there anyway to make this a userscript, mayhaps? I'd say it'd be mighty convenient!

by Gum Skyloard; ; Report

theoretically you could turn it into a bookmarklet with the code i posted in my reply. as for a userscript:


// ==UserScript==
// @name Style Remover
// @version 0.1
// @description Remove custom user style tags
// @match https://spacehey.com/*
// ==/UserScript==

(function() {

'use strict'
;

let removeStyle = document.createElement("button");
removeStyle.id = "removeStylebutton";
removeStyle.innerText = "Remove Style Tags";
removeStyle.style.width = "100%";
removeStyle.style.padding = "0.5rem";
removeStyle.style.fontFamily = "monospace";
removeStyle.style.backgroundColor = "#1E40AF";
removeStyle.style.color = "white";
removeStyle.style.fontSize = "0.75rem";

removeStyle.addEventListener("click", function(){
for(var i of document.getElementsByTagName("style")){
i.innerHTML = "";
}
});

document.getElementsByTagName("nav")[0].appendChild(removeStyle);
})();

by canto; ; Report