Skip to content

Add iOS pseudo-fullscreen shim for EmulatorJS player#3431

Merged
gantoine merged 3 commits into
masterfrom
copilot/fix-fullscreen-emulation-ios
May 25, 2026
Merged

Add iOS pseudo-fullscreen shim for EmulatorJS player#3431
gantoine merged 3 commits into
masterfrom
copilot/fix-fullscreen-emulation-ios

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Fullscreen requests from EmulatorJS were ignored on iOS, leaving the app chrome visible and the player constrained to the normal layout. This change adds an iOS-only fullscreen shim so EmulatorJS can enter and exit a pseudo-fullscreen mode while keeping RomM's fullscreen state in sync.

  • iOS fullscreen shim

    • Adds an EmulatorJS-scoped iOS workaround that reports document.fullscreenEnabled = true
    • Overrides requestFullscreen, webkitRequestFullscreen, and document.exitFullscreen for iOS devices only
    • Restores original browser descriptors when the player is torn down
  • Pseudo-fullscreen behavior

    • Expands the active player element to a fixed, full-viewport container
    • Uses 100svh sizing and a high z-index to cover the app shell
    • Preserves and restores the player element’s prior inline styles on exit
  • RomM UI/state synchronization

    • Hides Vuetify navigation chrome during pseudo-fullscreen:
      • .v-app-bar
      • .v-bottom-navigation
      • .v-navigation-drawer
    • Dispatches synthetic fullscreenchange events so existing fullscreen listeners continue to work without special-casing iOS
  • Lifecycle integration

    • Installs the shim before EmulatorJS loader initialization so fullscreen capability is visible to EmulatorJS at startup
    • Cleans up the shim on player unmount and loader failure paths
Object.defineProperty(document, "fullscreenEnabled", {
  configurable: true,
  get: () => true,
});

Object.defineProperty(HTMLElement.prototype, "requestFullscreen", {
  configurable: true,
  value: function requestFullscreen(this: HTMLElement) {
    return enterPseudoFullscreen(this);
  },
});

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fullscreen emulation issue on iOS Add iOS pseudo-fullscreen shim for EmulatorJS player May 25, 2026
Copilot AI requested a review from gantoine May 25, 2026 12:04
@gantoine gantoine marked this pull request as ready for review May 25, 2026 14:39
Copilot AI review requested due to automatic review settings May 25, 2026 14:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an iOS-only pseudo-fullscreen shim for the EmulatorJS player so fullscreen requests can work on iOS Safari while preserving existing fullscreen event flows.

Changes:

  • Adds iOS/iPadOS detection and fullscreen API overrides scoped to EmulatorJS setup.
  • Applies pseudo-fullscreen styling and hides Vuetify navigation chrome while active.
  • Installs the shim before EmulatorJS loader initialization and cleans it up on failures/unmount.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
frontend/src/views/Player/EmulatorJS/utils.ts Adds iOS fullscreen shim utilities, fullscreen API overrides, pseudo-fullscreen styles, event dispatching, and cleanup.
frontend/src/views/Player/EmulatorJS/Base.vue Installs the shim before EmulatorJS loads and removes it on loader failure or component teardown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gantoine gantoine merged commit 37bddd4 into master May 25, 2026
10 checks passed
@gantoine gantoine deleted the copilot/fix-fullscreen-emulation-ios branch May 25, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Fullscreen emulation broken on iOS — requestFullscreen not triggered

3 participants