Skip to content

Instantly share code, notes, and snippets.

@FrecklyComb1728
Last active November 27, 2025 14:30
Show Gist options
  • Select an option

  • Save FrecklyComb1728/7b58e085e797d727a6cbf823428348da to your computer and use it in GitHub Desktop.

Select an option

Save FrecklyComb1728/7b58e085e797d727a6cbf823428348da to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name QQ拦截页面重定向
// @namespace https://imbee.top
// @version 1.0
// @downloadURL https://gist.github.com/FrecklyComb1728/7b58e085e797d727a6cbf823428348da/raw/fuck-qq-redirect-block.user.js?no-cache-uuid=446d4a60-c564-11f0-94b9-0d35d4e306ab
// @updateURL https://gist.github.com/FrecklyComb1728/7b58e085e797d727a6cbf823428348da/raw/fuck-qq-redirect-block.user.js?no-cache-uuid=446d4a60-c564-11f0-94b9-0d35d4e306ab
// @description QQ点击跳转,网址被拦截问题。
// @author mifeng
// @license The Unlicense
// @match *://c.pc.qq.com/ios.html*
// @match *://c.pc.qq.com/middlem.html*
// @icon https://www.qq.com/favicon.ico
// @grant none
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
const urlParams = new URLSearchParams(window.location.search);
const targetUrl = urlParams.get('url') || urlParams.get('pfurl');
if (targetUrl) {
let decodedUrl = decodeURIComponent(targetUrl);
decodedUrl = decodedUrl.replace(/(%2F|\/)+$/i, '');
const urlObj = new URL(decodedUrl);
if (urlObj.pathname === '') {
decodedUrl += '/';
}
window.location.replace(decodedUrl);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment