Last active
March 8, 2022 02:28
-
-
Save whusnoopy/489c77059457c00c7b75 to your computer and use it in GitHub Desktop.
replace window.location.href on blocked jandan page and force http
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 unblock cnbeta | |
// @namespace http://cnbeta.com/ | |
// @downloadURL https://gist.github.com/whusnoopy/489c77059457c00c7b75/raw/unblock_cnbeta.user.js | |
// @version 0.3 | |
// @description force pc version on cnbeta during rss readers | |
// | |
// @match *://m.cnbeta.com/* | |
// | |
// @copyright 2017+, Snoopy | |
// | |
// @grant none | |
// | |
// ==/UserScript== | |
var origin_href = window.location.href; | |
var new_href = "http://www.cnbeta.com/articles/tech/" + origin_href.split('/')[4]; | |
// do jump if changed | |
if (new_href != window.location.href) { | |
window.location.href = new_href; | |
} |
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 unblock jandan | |
// @namespace http://jandan.net/ | |
// @downloadURL https://gist.github.com/whusnoopy/489c77059457c00c7b75/raw/unblock_jandan.user.js | |
// @version 0.5 | |
// @description unblock jandan during rss readers | |
// | |
// @match *://jandan.net/* | |
// | |
// @copyright 2013+, Snoopy | |
// | |
// @grant none | |
// | |
// ==/UserScript== | |
var origin_href = window.location.href; | |
// force http only cause images not load under https | |
// if (origin_href.indexOf('https') === 0) { | |
// origin_href = origin_href.replace(/https/, "http"); | |
// } | |
// get real link when blocked | |
if (origin_href.indexOf('block') >= 0) { | |
origin_href = origin_href.replace(/%2F/g, "\/"); | |
origin_href = origin_href.replace(/%3A/g, "\:"); | |
origin_href = origin_href.replace(/http.*http/, "http"); | |
} | |
// do jump if changed | |
if (origin_href != window.location.href) { | |
window.location.href = origin_href; | |
} |
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 unblock m.jd | |
// @namespace https://jd.com/ | |
// @downloadURL https://gist.github.com/whusnoopy/489c77059457c00c7b75/raw/unblock_jd.user.js | |
// @version 0.1 | |
// @description force pc version on cnbeta during rss readers | |
// | |
// @match *://item.m.jd.com/* | |
// | |
// @copyright 2021+, Snoopy | |
// | |
// @grant none | |
// | |
// ==/UserScript== | |
var origin_path = window.location.pathname; | |
var new_href = "https://item.jd.com/" + origin_path.split('/')[2]; | |
// do jump if changed | |
if (new_href != window.location.href) { | |
window.location.href = new_href; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment