Skip to content

Instantly share code, notes, and snippets.

@evanreichard
Created January 1, 2022 21:28
Show Gist options
  • Save evanreichard/5a9774f962c485f7007e31c548757a7b to your computer and use it in GitHub Desktop.
Save evanreichard/5a9774f962c485f7007e31c548757a7b to your computer and use it in GitHub Desktop.
pwa-everything.user.js
// ==UserScript==
// @name PWA Everything
// @author Evan Reichard
// @version 0.0.1
// @match *://*/*
// @grant none
// @run-at document-idle
// @noframes
// ==/UserScript==
let webManifest = {
"name": "",
"short_name": "",
"theme_color": "#ff0000",
"background_color": "#ff0000",
"display": "standalone"
};
let manifestElem = document.createElement('link');
manifestElem.setAttribute('rel', 'manifest');
manifestElem.setAttribute('href', 'data:application/manifest+json;base64,' + btoa(JSON.stringify(webManifest)));
document.head.prepend(manifestElem);
@btbristow
Copy link

@evanreichard, can one change the color behind the Dynamic Island? I tried a few options without success. On an iPhone 14 that area is black, but might work better as white on most websites!

Another option might be to hide the Safari address bar only (but not the site name island area) -- but I'm not sure if that's possible. Either way, thanks for the script!

@NeoArtTV
Copy link

Is there a way to change the code to do the opposite? I need to open an app that’s defaulted to standalone in a browser window, but changing the display attribute to "browser" doesn’t do anything :/ would love some help.

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