-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path423down_passby_GoPHP.user.js
More file actions
31 lines (29 loc) · 1.24 KB
/
423down_passby_GoPHP.user.js
File metadata and controls
31 lines (29 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @name 423Down - Skip transfer
// @name:zh-CN 423Down - 跳过中转
// @namespace https://github.com/Coconutat/browser-script-backup-Self-use
// @homepage https://github.com/Coconutat/browser-script-backup-Self-use
// @version 1.1.1
// @description Bypass the transfer of go.php
// @description:zh-CN 绕过 go.php 的中转
// @author pana(Backup by Coconutat)
// @license GNU General Public License v3.0 or later
// @match *://*.423down.com/*
// @match *://*.potplayer.org/*
// @icon https://cdn.jsdelivr.net/gh/423down/files@master/img/favicon.ico
// @grant none
// @compatible chrome
// @compatible firefox
// ==/UserScript==
(function () {
'use strict';
document.querySelectorAll('a').forEach(ele => {
if (ele.href && ele.href.includes('go.php?url')) {
if (ele.textContent && ele.textContent.match(/^https?:\/\//)) {
ele.href = ele.textContent;
} else if (ele.href.match(/url=((?:https?:\/\/)?[\w./-])/)) {
ele.href = 'http://' + ele.href.match(/url=(?:https?:\/\/)?([\w./-]+)/)[1];
}
}
});
})();