gpt4 book ai didi

google-chrome - Google Chrome - 覆盖网页加载之间的白色空白页

转载 作者:行者123 更新时间:2023-12-03 07:12:10 32 4
gpt4 key购买 nike

我正在寻找不同的 Chrome 应用程序来使我的页面变暗/倒置以减轻眼睛疲劳,我发现一些应用程序可以工作,但唯一剩下的东西(这些应用程序似乎没有覆盖)是白色空白页面.

加载新页面时,Chrome 首先会显示一个白色空白页面,然后在加载页面时显示网站的内容。有没有办法覆盖这个 While 页面来说 Black?目前,每次我单击链接或打开新网页时,屏幕都会从深色(通过反转/变暗页面应用程序)变为白色空白屏幕一小会儿,然后新页面再次以深色加载。每次加载新页面时,这就像屏幕上出现“白色闪光”一样,导致进一步的眼睛疲劳。这就是为什么我想知道是否有办法将这种白色覆盖为黑色。

诗。如果这篇文章出现在错误的论坛中,我深表歉意,Google Chrome 开发者页面有一个指向论坛的链接,正是它把我带到了这里:)

谢谢。

最佳答案

manifest.json

{
"name": "Background",
"permissions" : ["http://*/*", "https://*/*"],
"version": "1.0",
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["script.js"],
"all_frames": false,
"run_at": "document_start"
}],
"manifest_version": 2
}

脚本.js

var color = document.documentElement.style.backgroundColor;
document.documentElement.style.backgroundColor = "black";
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.target.nodeName == "BODY") {
observer.disconnect();
document.documentElement.style.backgroundColor = color || "";
}
});
});
observer.observe(document, { childList: true, subtree: true });

将所有文件放入一个文件夹中。在 Chrome 中,转到设置 -> 扩展 -> 打开开发者模式 -> 加载解压的扩展 -> 选择您刚刚创建的文件夹。

关于google-chrome - Google Chrome - 覆盖网页加载之间的白色空白页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16243105/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com