Last active
May 6, 2025 19:03
-
-
Save joshmckibbin/b3de1c4621e02c3294f355a22a667831 to your computer and use it in GitHub Desktop.
A bookmarklet for easily switching between different Outlook mailboxes.
This file contains hidden or 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
| javascript:(function() { | |
| const emails = [ | |
| '[email protected]', | |
| '[email protected]', | |
| '[email protected]' | |
| ]; | |
| const baseUrl = 'https://outlook.office365.com/mail/'; | |
| if ( ! window.location.href.includes( baseUrl ) ) { | |
| alert( 'This bookmarklet only works on Outlook email pages.' ); | |
| return; | |
| } | |
| var emailIndex = localStorage.getItem( 'outlookEmailIndex' ); | |
| if ( emailIndex === null ) { | |
| emailIndex = 0; | |
| for( const [i, email] of emails.entries() ) { | |
| if ( window.location.href.includes(email) ) { | |
| emailIndex = i; | |
| break; | |
| } | |
| } | |
| } | |
| emailIndex++; | |
| if ( emailIndex > emails.length - 1 ) { | |
| emailIndex = 0; | |
| } | |
| localStorage.setItem( 'outlookEmailIndex', emailIndex ); | |
| window.open( baseUrl + emails[emailIndex], '_self' ); | |
| })(); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
For Outlook on the Web