自动访问纽约时报中文网简体中文页面
// ==UserScript==
// @name 访问纽约时报中文网简中页面
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动访问纽约时报中文网简体中文页面
// @author Dylan_Zhang
// @match https://cn.nytimes.com/*/*/*/*/
// @match https://cn.nytimes.com/*/*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=nytimes.com
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// 获取当前页面的URL
var currentURL = window.location.href;
// 将"zh-hant"替换为"zh-hans"
var newURL = currentURL.replace("zh-hant", "zh-hans");
// 判断新旧URL是否相同,如果不同则重定向到新URL
if (newURL !== currentURL) {
window.location.replace(newURL);
}
})();