我一直在寻找一种通过用户脚本(GreaseMonkey,TamperMonkey...)重写特定网址的方法。我找到了替换特定域名的所有部分的解决方案,而不仅仅是一个url。
更准确地说,在邮件邮箱(icoud.com/ iCloud )上,我想用https://mail.google.com/mail/?view=cm&fs=1&tf=1替换https://www.icloud.com/message/current/en-us/index.html#compose
我根本不是脚本专家,我不知道从哪里开始
非常感谢
发布于 2019-09-25 22:57:28
玩玩之后,我找到了解决方案
// ==UserScript==
// @name rewrite
// @namespace https://icloud.com/
// @version 1.0
// @author Gee
// @match https://www.icloud.com/message/*
// @include * https://www.icloud.com/message/*
// @grant none
// ==/UserScript==
var current_url = document.location;
var new_url = "https://mail.google.com/mail/?view=cm&fs=1&tf=1";
location.replace(new_url);https://stackoverflow.com/questions/58093764
复制相似问题