您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
AMP sucks, thus no AMP thanks.
当前为
// ==UserScript== // @name deAMP // @name:zh-TW deAMP // @description AMP sucks, thus no AMP thanks. // @description:zh-TW 垃圾 AMP,好走不送。 // @author Jason Kwok // @namespace https://jasonhk.dev/ // @version 2.2.3 // @license MIT // @match *://*/* // @run-at document-end // @grant GM.getValue // @grant GM.setValue // @require https://cdn.jsdelivr.net/npm/[email protected]/uuid-random.min.js // @supportURL https://gf.qytechs.cn/scripts/450569/feedback // ==/UserScript== (async () => { const SESSION_KEY = await getSessionKey(); const isAmp = document.documentElement.hasAttribute("⚡") || document.documentElement.hasAttribute("amp"); const canonical = document.head.querySelector("link[rel=canonical][href]"); if (isAmp && (canonical !== null)) { const lastVisit = sessionStorage.getItem(SESSION_KEY); if (location.href === lastVisit) { console.debug("[deAMP] Last visited URL is the current URL, abort redirection."); sessionStorage.removeItem(SESSION_KEY); } else if (location.href === canonical.href) { console.debug("[deAMP] Canonical URL is the current URL, abort redirection."); sessionStorage.removeItem(SESSION_KEY); } else { console.debug(`[deAMP] Redirecting to canonical URL: ${canonical.href}`); sessionStorage.setItem(SESSION_KEY, location.href); location.replace(canonical.href); } } else { console.debug("[deAMP] Not an AMP page."); sessionStorage.removeItem(SESSION_KEY); } async function getSessionKey() { let key = await GM.getValue("SESSION_KEY"); if (key) { return key; } key = uuid(); GM.setValue("SESSION_KEY", key); return key; } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址