Last active
September 23, 2020 08:43
-
-
Save henrahmagix/0827a1fce0d4bd70c51642c87fd781b6 to your computer and use it in GitHub Desktop.
Chrome extension to always select a specific user for Google Cloud Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = new URL(window.location); | |
let authuser = url.searchParams.get('authuser'); | |
// Log in as the account you always want to be logged-in as | |
// and replace 1 here with the authuser=N number in the url. | |
if (!authuser) { | |
url.searchParams.set('authuser', '1'); | |
window.history.replaceState(null, null, url.toString()); | |
window.location.reload; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "Always login as specific user to Google Cloud Console", | |
"version": "0.1", | |
"content_scripts": [ | |
{ | |
"matches": [ | |
"https://cloud.google.com/*", | |
"https://console.cloud.google.com/*" | |
], | |
"js": [ | |
"content.js" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions for how to load a custom extension are here: https://robots.thoughtbot.com/how-to-make-a-chrome-extension