Skip to content

Instantly share code, notes, and snippets.

@martyzz1
Last active July 27, 2021 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martyzz1/bad31146fb1a74afa3ffc110f16274dc to your computer and use it in GitHub Desktop.
Save martyzz1/bad31146fb1a74afa3ffc110f16274dc to your computer and use it in GitHub Desktop.
Make Chrome app for a given url
const startUrl = window.location.href;
document.head
.querySelector(':first-child')
.insertAdjacentHTML(
'beforebegin',
`<link rel="manifest" href='data:application/manifest+json,{"start_url":"${startUrl}"}' />`,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment