1

I have been looking for a way to rewrite a specific URL via a userscript (GreaseMonkey, TamperMonkey...). I found solutions to replace all parts of a specific domain but not just one url.

More precisely, on iCloud Mail (icloud.com/mail) I want to replace https://www.icloud.com/message/current/en-us/index.html#compose with https://mail.google.com/mail/?view=cm&fs=1&tf=1

I am not a script expert at all, si I am not sure where to start

Thank you very much

Gee B
  • 77
  • 1
  • 6

1 Answers1

6

Nevermind after playing around I found the solution

// ==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);
Gee B
  • 77
  • 1
  • 6