Last active
June 24, 2024 06:18
-
-
Save lumynou5/5437fb5ca0ae61d126afe3aa76cf3027 to your computer and use it in GitHub Desktop.
Remove the redirections for external links on Bahamut.
This file contains 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
// ==UserScript== | |
// @name Bahamut No External Link Redirection | |
// @version 0.1.1 | |
// @description Remove the redirections for external links on Bahamut. | |
// @description:zh-TW 移除巴哈姆特上的外部連結重新導向。 | |
// @author Lumynous | |
// @license MIT | |
// @match https://*.gamer.com.tw/* | |
// @noframes | |
// @downloadURL https://gist.github.com/lumynou5/5437fb5ca0ae61d126afe3aa76cf3027/raw/bahamut-no-external-link-redirection.user.js | |
// ==/UserScript== | |
document.querySelectorAll('a[href^="https://ref.gamer.com.tw/redir.php?"]').forEach((x) => { | |
x.href = decodeURIComponent(x.search.match(/\?url=(.*)/)[1]); | |
}); | |
document.querySelectorAll('a[onclick="Forum.Common.refUrl(this);"]').forEach((x) => { | |
x.removeAttribute('onclick'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment