Last active
December 19, 2022 06:08
-
-
Save y-mamanaranu/1a09a062485ecdde8f58644040f522c4 to your computer and use it in GitHub Desktop.
Open external link fo Github wiki in new tab.
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
| // ==UserScript== | |
| // @name Github - Open External Link of Wiki in New Tab | |
| // @namespace https://github.com/y-muen | |
| // @license MIT | |
| // @version 0.1 | |
| // @description Open external link fo Github wiki in new tab. | |
| // @author Yoiduki <y-muen> | |
| // @match *://github.com/*/*/wiki/* | |
| // @icon https://www.google.com/s2/favicons?domain=github.com | |
| // @grant none | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | |
| // @updateURL https://gist.github.com/y-muen/1a09a062485ecdde8f58644040f522c4/raw/github-wiki-link-in-new-tab.js | |
| // @downloadURL https://gist.github.com/y-muen/1a09a062485ecdde8f58644040f522c4/raw/github-wiki-link-in-new-tab.js | |
| // @supportURL https://gist.github.com/y-muen/1a09a062485ecdde8f58644040f522c4 | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| $('a').each(function () { | |
| var a = new RegExp('/' + window.location.host + '/'); | |
| if (!a.test(this.href)) { | |
| $(this).attr({ 'target': '_blank', 'rel': 'noopener noreferrer' }); | |
| } | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment