Skip to content

Commit

Permalink
cosmetic changes to new CWS page
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverDecaf committed Nov 21, 2023
1 parent ce2948a commit e5b52d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/scripts/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ var modifyButtonObserverNew = new MutationObserver(function (
const btn = mutation.target.querySelector(
"button.UywwFc-LgbsSe-OWXEXe-dgl2Hf",
);
const header = mutation.target.querySelector(".KgGEHd");
header && header.setAttribute("target", "_top");
if (btn && !btn.hasAttribute("isInstallBtn")) {
btn.setAttribute("isInstallBtn", "true");
chrome.runtime.sendMessage(
Expand Down Expand Up @@ -192,7 +194,17 @@ if (is_cws.test(window.location.href)) {
childList: true,
});
}
function injectCSS(cssCode) {
var style = document.createElement("style");
style.textContent = cssCode;
document.head.appendChild(style);
}
if (is_ncws.test(window.location.href)) {
injectCSS(`
div[jscontroller="o2G9me"].gSrP5d#c2[jsaction="rcuQ6b:npT2md;KKVPLd:KrIKWc;JIbuQc:M4KNod"] {
display: none;
}
`);
modifyButtonObserverNew.observe(document.body, {
childList: true,
});
Expand Down

0 comments on commit e5b52d6

Please sign in to comment.