Skip to content

Instantly share code, notes, and snippets.

@rbreaves
Created September 27, 2024 02:26
Show Gist options
  • Save rbreaves/393b2e28dfb0a57fec4d8ebc4276b473 to your computer and use it in GitHub Desktop.
Save rbreaves/393b2e28dfb0a57fec4d8ebc4276b473 to your computer and use it in GitHub Desktop.
PWA Any Website with a bookmarklet on iOS/Android
javascript:(function() {
var manifestContent = {
"name": "YouTube PWA",
"short_name": "YouTube PWA",
"start_url": "/",
"display": "fullscreen",
"background_color": "#000000",
"theme_color": "#FF0000",
"orientation": "landscape-primary",
};
var dataUrl = 'data:application/manifest+json,' + encodeURIComponent(JSON.stringify(manifestContent));
var link = document.createElement('link');
link.rel = 'manifest';
link.href = dataUrl;
document.head.appendChild(link);
alert('Custom manifest.json has been inserted!');
})();
@rbreaves
Copy link
Author

This bookmarklet generates an inline manifest.json file for youtube specifically but can be applied to literally any website a user may want to create a custom manifest file for.

The major benefit is that you can have fullscreen apps for websites that otherwise would not allow you to create a fullscreen app/experience for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment