Skip to content

Instantly share code, notes, and snippets.

@ShingoFukuyama
Last active July 25, 2017 15:20
Show Gist options
  • Save ShingoFukuyama/fafe903d2f078375d99c556707574699 to your computer and use it in GitHub Desktop.
Save ShingoFukuyama/fafe903d2f078375d99c556707574699 to your computer and use it in GitHub Desktop.
A bookmarklet for Mobile Safari (iPhone/iPad). Make normal websites as standalone applications.
javascript:;(function(d) {let html = d.querySelector('html');let head = d.querySelector('head');if (!head) {head = d.createElement('head');html.appendChild(head);}let meta1 = d.querySelector('meta[name=apple-mobile-web-app-capable]');if (meta1) {meta1.content = 'yes';} else {meta1 = d.createElement('meta');meta1.name = 'apple-mobile-web-app-capable';meta1.content = 'yes';head.appendChild(meta1);}let meta2 = d.querySelector('meta[name=apple-mobile-web-app-status-bar-style]');if (meta2) {meta2.content = 'black'; /* black-translucent, black, default */} else {meta2 = d.createElement('meta');meta2.name = 'apple-mobile-web-app-status-bar-style';meta2.content = 'black';head.appendChild(meta2);}})(document);
@ShingoFukuyama
Copy link
Author

  1. Open a certain web page on Safari
  2. Use this bookmarklet
  3. Share > "Add to Home Screen"

@ShingoFukuyama
Copy link
Author

  1. WebページをSafariで開く
  2. このブックマークレットを発動させる
  3. 共有から「ホーム画面に追加」をする

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