Skip to content

Instantly share code, notes, and snippets.

@Syakhisk
Created November 27, 2023 06:36
Show Gist options
  • Save Syakhisk/3e5db025b11eb4334de6cf28dd80b8ca to your computer and use it in GitHub Desktop.
Save Syakhisk/3e5db025b11eb4334de6cf28dd80b8ca to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Google Account Auto Switcher
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://calendar.google.com/calendar/u/0/*
// @match https://drive.google.com/drive/u/0/*
// @match https://mail.google.com/mail/u/0/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// @run-at document-start
// @noframes
// ==/UserScript==
(async function () {
"use strict";
const targetAccountNumber = 1;
const url = new URL(window.location.href);
url.pathname = url.pathname.replace(
/\/u\/\d+\//,
`/u/${targetAccountNumber}/`,
);
window.location.replace(url);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment