macOS: Adding Gmail App(s) for One or More Gmail Accounts
How to Create the First Gmail App
Adding an app to directly open your Gmail account from the Dock is as simple as this:
Now you should have an app in the Dock for your Gmail account!
How to Create Additional Gmail Apps
You may like to have additional apps which open directly into different Gmail accounts. Unfortunately, it's not as simple as opening your additional Gmail account/inbox in a new Chrome window and following the process above.
Here is how to add additional Gmail account apps:
1. Open the additional Gmail account/inbox in a new Chrome window.
2. Open the Chrome Devtools (right click anywhere on the page and select "Inspect").
3. Go to the Console tab.
4. Enter the following:
领英推荐
allow paste <enter>
5. Copy the following script into the Console, but replace the email address ([email protected]) according to your needs, and then press <enter>:
const startUrl = 'https://mail.google.com/mail/u/[email protected]/%23inbox';
const unsanitizedHtmlPolicy = trustedTypes.createPolicy('unsanitizedHtml', {
createHTML: (htmlString) => htmlString,
});
document.head
.querySelector(':first-child')
.insertAdjacentHTML(
'beforebegin',
unsanitizedHtmlPolicy.createHTML(
`<link rel="manifest" href='data:application/manifest+json,{"start_url":"${startUrl}"}' />`,
),
);
6. Once you have done this, you can create the app in a similar way to before:
a) Click on the 'Three Dots Menu' -> 'Save and Share' -> 'Create Shortcut...'.
b) Enter a name for the app.
c) Tick 'Open as window' and then click 'Create'.
d) Your new app will open and will be present in the Dock.
e) Right-click on the app in the Dock, click 'Options' -> 'Keep in Dock'.
Now you should have a separate app in the Dock for your second/additional Gmail account!