javascript - How to change CSS-Style with Greasemonkey? - Stack Overflow

I'm trying to write a small script for Greasemonkey, but it does not work, because I have little e

I'm trying to write a small script for Greasemonkey, but it does not work, because I have little experience.

It is necessary to replace all properties CSS with a value (background: #fff;) on (background: #e8e8e8;).

I'm trying to write a small script for Greasemonkey, but it does not work, because I have little experience.

It is necessary to replace all properties CSS with a value (background: #fff;) on (background: #e8e8e8;).

Share Improve this question edited Aug 31, 2017 at 16:06 Vova Dima asked Aug 31, 2017 at 11:14 Vova DimaVova Dima 111 silver badge2 bronze badges 1
  • 2 To change CSS you use Stylish instead. – user5734311 Commented Aug 31, 2017 at 11:16
Add a ment  | 

2 Answers 2

Reset to default 4
// ==UserScript==
// @name        Background color change
// @namespace   https://website here
// @description Changes the background color
// @version     1
// @grant       none
// ==/UserScript==

document.body.style.background = "white";

Simply add,

GM_addStyle("body { background-color: #fff !
    important; }");

Important may not be needed.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745661438a4638859.html

相关推荐

  • javascript - How to change CSS-Style with Greasemonkey? - Stack Overflow

    I'm trying to write a small script for Greasemonkey, but it does not work, because I have little e

    22天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信