Skip to content

Instantly share code, notes, and snippets.

@ldanielswakman
Last active March 30, 2023 11:49
Show Gist options
  • Save ldanielswakman/012c840792adcf6bd6262cfe55718c7e to your computer and use it in GitHub Desktop.
Save ldanielswakman/012c840792adcf6bd6262cfe55718c7e to your computer and use it in GitHub Desktop.
Google Calendar PWA manifest
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