QQ Open Link Directly 自动跳转 当前网页非官方页面/已停止访问该网页

点击 QQ 客户端中的链接后,自动跳转中转提示页 "当前网页非官方页面" 或 "已停止访问该网页" 至原网址

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         QQ Open Link Directly 自动跳转 当前网页非官方页面/已停止访问该网页
// @namespace    https://github.com/willbchang/userscript-qq-open-link-directly/
// @version      1.1.1
// @description  点击 QQ 客户端中的链接后,自动跳转中转提示页 "当前网页非官方页面" 或 "已停止访问该网页" 至原网址
// @author       Will B Chang
// @match        *://c.pc.qq.com/*
// @grant        none
// @license      AGPL-V3
// ==/UserScript==


(function() {
    'use strict';
    const url = new URL(window.location.href)
    // pfurl 对应 当前网页非官方页面
    // url 对应 已停止访问该网页
    let target = url.searchParams.get('pfurl') || url.searchParams.get('url')
    if (target.endsWith('//')) target = target.slice(0, -1)
    window.location.href = target;
})();