Created
September 27, 2024 02:26
-
-
Save rbreaves/393b2e28dfb0a57fec4d8ebc4276b473 to your computer and use it in GitHub Desktop.
PWA Any Website with a bookmarklet on iOS/Android
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
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!'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.