Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Colors Greasemonkey编码查询:更改文本颜色/样式&/或者使自定义背景图像更亮/更透明?_Colors_Background Image_Customization_Greasemonkey - Fatal编程技术网

Colors Greasemonkey编码查询:更改文本颜色/样式&/或者使自定义背景图像更亮/更透明?

Colors Greasemonkey编码查询:更改文本颜色/样式&/或者使自定义背景图像更亮/更透明?,colors,background-image,customization,greasemonkey,Colors,Background Image,Customization,Greasemonkey,我目前使用自定义代码将大多数网站(包括谷歌)的默认白色背景更改为背景图像。然而,在一些页面上,文本是黑色的,这使得我很难对照我选择的图像来阅读。我想让每个页面上有自定义BG图像的字体都具有对比色以便于阅读,但当我试图添加到代码中时,它会将我的图像替换为一个空白的白色背景,这与目的背道而驰。以下是当前代码: // @name Custom Google Background // @namespace http://localhost // @include http://www.googl

我目前使用自定义代码将大多数网站(包括谷歌)的默认白色背景更改为背景图像。然而,在一些页面上,文本是黑色的,这使得我很难对照我选择的图像来阅读。我想让每个页面上有自定义BG图像的字体都具有对比色以便于阅读,但当我试图添加到代码中时,它会将我的图像替换为一个空白的白色背景,这与目的背道而驰。以下是当前代码:

 // @name Custom Google Background
 // @namespace http://localhost
 // @include http://www.google.*/*
 // @include https://www.google.*/*
 // @exclude http://www.google.*/search*
 // @exclude https://www.google.*/search*
 // @exclude http://www.google.*/reader*
 // @exclude https://www.google.*/reader*
 // @exclude http://www.google.*/calendar*
 // @exclude https://www.google.*/calendar*
 // @exclude http://www.google.*/ig*
 // @exclude https://www.google.*/ig*
 // @version     1.0
 // @grant       none
 // ==/UserScript==

 var backgroundgImg = "https://i.postimg.cc/tTnzyDq0/Grand-Universe-by-ANTIFAN-REAL.jpg";
 var bodyStyle = document.getElementsByTagName("body")[0].style;
 bodyStyle.backgroundImage = "url('" + backgroundgImg + "')";
 bodyStyle.backgroundRepeat = "no-repeat";
 bodyStyle.backgroundPosition = "center top";
 bodyStyle.backgroundSize = "cover";```

I have tinkered with inspecting the element on [a page][1] that didn't display a readable font, & used the Style Editor to improve it with these elements:

``` {
     background-color: #E3E4FA;
     font-family: "Times New Roman", Candara, Segoe, Segoe UI, Optima, Arial, Helvetica, sans-serif;
     font-size: 18px;
     font-weight: bold;
     color: #C38EC7;
 }```

However, I don't want to do this every single time for every page that's like this; I want it done automatically. Alternatively, is there a way to make my background image slightly transparent, enough so that it's still a dark display, but I can still read the text?  Other than popping it in Photoshop, of course.

Here's an example of what a portion of a page looks like with the current code: [section of sample webpage][2]

Here's what it looks like with modifications to the Style Editor: [section of sample ideal layout][3]

Thanks for any help you can offer me!


[1]: https://www.csprousers.org/help/CSPro/capture_types.html
[2]: https://i.stack.imgur.com/RVGLy.jpg
[3]: https://i.stack.imgur.com/T1qbk.jpg