// ==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;
}
})();