Created
January 24, 2025 19:58
-
-
Save RepComm/e547574cd336a8953613fcf5f1e22b06 to your computer and use it in GitHub Desktop.
goodbye_blank (removes _blank) - currently only supports bing.com, will edit in future
This file contains hidden or 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
//content.js | |
function goodbye_blank() { | |
console.log("removing _blanks") | |
for (const a of document.querySelectorAll("a")) { | |
if (a.target == "_blank") { | |
a.target = ""; | |
} | |
} | |
} | |
setInterval( () => { | |
goodbye_blank() | |
}, 300); |
This file contains hidden or 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
{ | |
"name": "goodbye_blank", | |
"description": "_blank is bad, goodbye!", | |
"version": "1.0", | |
"manifest_version": 3, | |
"content_scripts": [{ | |
"matches": ["*://*.bing.com/*", "*://bing.com/*"], | |
"js": ["content.js"], | |
"run_at": "document_start", | |
"all_frames": true | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment