使用JS动态修改网页body的背景色
// ==UserScript==
// @name ChangeBackgroundColor
// @namespace tingl
// @include *
// @version 1
// @grant none
// ==/UserScript==
(function () {
'use strict';
var color = '#ececec';
var style;
function createStyle() {
style = ('style');
= 'text/css';
= 'body {background-color: ' + color + ' !important;}';
}
function changeBackgroundColor() {
if(!) (style);
}
createStyle();
changeBackgroundColor();
("DOMNodeRemoved",changeBackgroundColor);
}) ()