Last active
March 30, 2023 11:49
-
-
Save ldanielswakman/012c840792adcf6bd6262cfe55718c7e to your computer and use it in GitHub Desktop.
Google Calendar PWA manifest
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
const startUrl = 'https://calendar.google.com/calendar/u/1/r'; | |
const manifestData = encodeURIComponent(JSON.stringify({ | |
"short_name": "Calendar", | |
"name": "Google Calendar", | |
"icons": [ | |
{ | |
"src": "https://www.gstatic.com/calendar/images/manifest/logo_2020q4_192.png", | |
"type": "image/png", | |
"sizes": "192x192" | |
}, | |
{ | |
"src": "https://www.gstatic.com/calendar/images/manifest/logo_2020q4_512.png", | |
"type": "image/png", | |
"sizes": "512x512" | |
}, | |
{ | |
"src": "https://www.gstatic.com/calendar/images/manifest/logo_32.png", | |
"type": "image/png", | |
"sizes": "32x32" | |
} | |
], | |
"start_url": `${startUrl}`, | |
"background_color": "#FFFFFF", | |
"theme_color": "#F1F3F4" | |
})); | |
document.head | |
.querySelector(':first-child') | |
.insertAdjacentHTML( | |
'beforebegin', | |
`<link rel="manifest" href='data:application/manifest+json,${manifestData}' />`, | |
); | |
console.log('inserted!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment