insert_css

insert css

Mint 2022.03.13.. Lásd a legutóbbi verzió

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 or Violentmonkey 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         insert_css
// @include      *
// @supportURL   https://github.com/sxlgkxk/browser_script/issues
// @version      0.1
// @description  insert css
// @namespace    http://sxlgkxk.github.io/
// @author       sxlgkxk
// @icon         http://sxlgkxk.github.io/im/avatar.jpg
// @license      MIT
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_xmlhttpRequest
// ==/UserScript==

/*
div.container.full{color: #ccc; background:#232323}div.chapterContent{line-height:200% !important; width: 40% !important; font-size: 22px !important}
a:visited{color: #fabd2f !important;}
*/

(function(){

body=document.querySelector('body')
css_dom=document.createElement('div')
body.after(css_dom)

custom_css=localStorage.getItem('custom_css')
if(!custom_css) custom_css=""

css_dom.innerHTML=`<style>
	button#changeCssBtn{

	}`
	+custom_css+
`</style>
<button onclick="document.changeCSS()" id="changeCssBtn">change css</button>`

document.changeCSS=()=>{
	_custom_css=localStorage.getItem('custom_css')
	if(!custom_css) custom_css=""
	custom_css=prompt("css?", _custom_css)
	if(custom_css)
		localStorage.setItem("custom_css", custom_css)
}

})();