mirror of
https://github.com/TommyFang2077/dsh-desktop.git
synced 2026-08-17 09:06:36 +08:00
Add README, plugin citations, and multi-platform release CI.
Ship screenshots and third-party notices for the desktop shell, and package Windows, macOS, deb, rpm, and Flatpak from GitHub Releases. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
35
ui/inject/hide-twins.js
Normal file
35
ui/inject/hide-twins.js
Normal file
@@ -0,0 +1,35 @@
|
||||
(function () {
|
||||
const SUFFIX = " (modlens vision)";
|
||||
function textOf(el) {
|
||||
return (el.textContent || "").replace(/\s+/g, " ").trim();
|
||||
}
|
||||
function hideTwins(root) {
|
||||
const nodes = root.querySelectorAll("button, [role='menuitem'], [role='option'], [role='group'], h1, h2, h3, h4, span, div, p");
|
||||
const visionBases = new Set();
|
||||
for (const el of nodes) {
|
||||
if (el.childElementCount > 3) continue;
|
||||
const t = textOf(el);
|
||||
if (t.endsWith(SUFFIX) && t.length > SUFFIX.length) {
|
||||
visionBases.add(t.slice(0, -SUFFIX.length));
|
||||
}
|
||||
}
|
||||
if (visionBases.size === 0) return;
|
||||
for (const el of nodes) {
|
||||
if (el.childElementCount > 3) continue;
|
||||
const t = textOf(el);
|
||||
if (!visionBases.has(t)) continue;
|
||||
const row = el.closest("[role='group'], [role='menuitem'], li, section") || el;
|
||||
if (row && row.style.display !== "none") row.style.display = "none";
|
||||
}
|
||||
}
|
||||
const run = function () {
|
||||
try { hideTwins(document.body); } catch (e) {}
|
||||
};
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", run);
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
const obs = new MutationObserver(run);
|
||||
obs.observe(document.documentElement, { childList: true, subtree: true });
|
||||
})();
|
||||
Reference in New Issue
Block a user