Skip to content

Instantly share code, notes, and snippets.

@kbauer
Last active November 2, 2023 07:23
Show Gist options
  • Save kbauer/40edaaffc28fbaa881cd9cb58e4a7bc4 to your computer and use it in GitHub Desktop.
Save kbauer/40edaaffc28fbaa881cd9cb58e4a7bc4 to your computer and use it in GitHub Desktop.
javascript: body.document.requestFullscreen(); undefined
// Bookmarklet, that allows triggering fullscreen mode in mobile browser/website combinations,
// that don't give the option explicitly. Useful when using webapps on mobile,
// e.g. Teams, lesen.amazon.de (read.amazon.com), ...
//
// Useless on desktop browsers, where the F11 key usually triggers full-screen.
//
// Does not work on iOS, because the iOS javascript engines do not implement any fullscreen API.
// Instead, a more limited
//
// DOMELEMENT.webkitEnterFullscreen()
//
// API is provided, that should work only on media element (i.e. videos) [1]. The documentation
// provided by apple confirms this indirectly; The webkit Javascript documentation [2,3] when
// searching full fullScreen, documents `webkitEnterFullscreen()` only for `HTMLVideoElement`.
//
// [1] https://stackoverflow.com/a/39083376/2075630
// [2] https://developer.apple.com/documentation/webkitjs
// [3] https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1633500-webkitenterfullscreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment