|
|
本帖最后由 8978去二娃阿 于 2026-8-9 21:29 编辑
ChatGPT 故障,ChatGPT 的对话框位置,点击添加文件这些按钮,疯狂闪烁,已测试重新下载百分浏览器,完全空白百分的,也是这样、别的浏览器正常!

AI了一套脚本,已解决ChatGPT按钮闪烁问题,这个BUG只能等百分浏览器大更新了。
// ==UserScript==
// @name ChatGPT Cent Browser popover=hint 完整修复
// @namespace centbrowser-chatgpt-fix
// @version 1.1
// @description 修复 Cent Browser / Chromium 134 下 ChatGPT popover="hint" 闪烁及底部残留细线
// @match https://chatgpt.com/*
// @match https://chat.openai.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
(function () {
'use strict';
// ============================================================
// 1. CSS 强制隐藏所有 popover="hint"
// 防止 Chromium 134 top-layer 绘制造成闪烁/底部细线
// ============================================================
const style = document.createElement('style');
style.textContent = `
[popover="hint"] {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
border: 0 !important;
outline: 0 !important;
box-shadow: none !important;
background: transparent !important;
width: 0 !important;
height: 0 !important;
min-width: 0 !important;
min-height: 0 !important;
padding: 0 !important;
margin: 0 !important;
pointer-events: none !important;
}
[popover="hint"]::backdrop {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
background: transparent !important;
}
`;
function addStyle() {
if (document.head) {
document.head.appendChild(style);
} else {
document.documentElement.appendChild(style);
}
}
addStyle();
// ============================================================
// 2. 在 hint 打开之前直接取消
// ============================================================
document.addEventListener(
'beforetoggle',
function (event) {
if (event.newState !== 'open') return;
const target = event.target;
if (
target instanceof HTMLElement &&
target.getAttribute('popover') === 'hint'
) {
event.preventDefault();
}
},
true
);
// ============================================================
// 3. 如果 Chromium 134 偶尔仍然错误打开 hint
// 马上关闭
// ============================================================
document.addEventListener(
'toggle',
function (event) {
const target = event.target;
if (
target instanceof HTMLElement &&
target.getAttribute('popover') === 'hint'
) {
try {
if (target.matches(':popover-open')) {
target.hidePopover();
}
} catch (_) {
// Chromium 旧版本忽略
}
}
},
true
);
// ============================================================
// 4. ChatGPT 是 React 动态页面
// 对后来生成的 hint 再做一次保险处理
// ============================================================
const observer = new MutationObserver(function (mutations) {
for (const mutation of mutations) {
for (const node of mutation.addedNodes) {
if (!(node instanceof HTMLElement)) continue;
if (node.getAttribute('popover') === 'hint') {
suppressHint(node);
}
node.querySelectorAll?.('[popover="hint"]').forEach(
suppressHint
);
}
}
});
function suppressHint(el) {
try {
if (el.matches(':popover-open')) {
el.hidePopover();
}
} catch (_) {}
// 再加一道保险
el.style.setProperty('display', 'none', 'important');
el.style.setProperty('visibility', 'hidden', 'important');
el.style.setProperty('opacity', '0', 'important');
el.style.setProperty('border', '0', 'important');
el.style.setProperty('box-shadow', 'none', 'important');
el.style.setProperty('outline', '0', 'important');
el.style.setProperty('pointer-events', 'none', 'important');
}
function startObserver() {
if (!document.documentElement) {
requestAnimationFrame(startObserver);
return;
}
observer.observe(document.documentElement, {
childList: true,
subtree: true
});
}
startObserver();
console.log(
'[Cent Browser Fix] ChatGPT popover="hint" 闪烁/残留线修复已启用'
);
})();
|
-
|