-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,3 +121,7 @@ | |
- 兼容 img 的 `srcset` 属性 | ||
- 去掉重复的资源 | ||
- 修改按钮的动态透明度,不遮挡内容 | ||
|
||
## 黑白 | ||
|
||
黑白化网站。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// ==UserScript== | ||
// @name 黑白 | ||
// @namespace https://github.com/yujinpan/tampermonkey-extension | ||
// @version 1.0 | ||
// @license MIT | ||
// @description 网站黑白化。 | ||
// @author yujinpan | ||
// @include http*://** | ||
// ==/UserScript== | ||
|
||
(function () { | ||
var html = document.querySelector('html'); | ||
var style = html.getAttribute('style') || ''; | ||
if (style && style.slice(-1) !== ';') style += ';'; | ||
html.setAttribute('style', | ||
style + | ||
'filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);' + | ||
'filter: grayscale(100%);'); | ||
})(); |