经济学人油猴脚本

// ==UserScript==
// @name     Combined Google Web Cache Redirect and Link Modifier
// @version  1.1
// @grant    none
// @match    *://*/*
// @run-at   document-start
// ==/UserScript==
(function() {
    'use strict';

    var currentUrl = window.location.href;
    var urlObj = new URL(currentUrl);

    // 仅使用协议、主机名和路径构建Google缓存的URL
    var baseUrl = urlObj.origin + urlObj.pathname;

    if ((urlObj.hostname.includes("www.economist.com") || urlObj.hostname.includes("www.theatlantic.com")) && !currentUrl.includes("webcache.googleusercontent.com/search?q=cache:")) {
        // 构建Google缓存的URL
        var cacheUrl = "https://webcache.googleusercontent.com/search?q=cache:" + baseUrl;

        // 重定向到Google缓存的URL
        window.location.href = cacheUrl;
    }
})();

 

posted @ 2024-04-09 00:26  zed99  阅读(80)  评论(0编辑  收藏  举报