Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open immersive experiences directly #1171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felipeerias
Copy link
Contributor

@felipeerias felipeerias commented Jan 10, 2024

This PR implements support for opening immersive experiences directly as soon as the application is launched.

We do this by adding a built-in extension which will activate a particular element in the page.

We need to set the preference dom.vr.require-gesture to false so this script can launch immersive WebXR experiences.

The information required to identify the element to activate is passed as parameters to the Intent:

  • open_in_immersive : enables automatic immersive mode
  • open_in_immersive_parent_xpath : the XPath of the parent element (usually an iframe); if null, we assume the root document
  • open_in_immersive_element_xpath : within that parent, the XPath to identify the element to activate
  • the Intent must also contain a target URL to open

@felipeerias
Copy link
Contributor Author

felipeerias commented Jan 10, 2024

This PR can be tested from the command line with:

adb shell am start -n "com.igalia.wolvic/com.igalia.wolvic.VRBrowserActivity" \
    -a android.intent.action.MAIN                                             \
    -c android.intent.category.LAUNCHER                                       \
    -a android.intent.action.VIEW                                             \
    -d "https://heyvr.io/arcade/games/barista-express"                        \
    --ez open_in_immersive true                                               \
    --ez hide_webxr_interstitial true                                         \
    -e open_in_immersive_parent_xpath '//*[@id="game-frame"]'                 \
    -e open_in_immersive_element_xpath '/html/body/a-scene/div[2]/button'

This PR implements support for opening immersive experiences directly
as soon as the application is launched.

We do this by adding a built-in extension which will activate a
particular element in the page.

We need to set the preference dom.vr.require-gesture to false so this
script can launch immersive WebXR experiences.

The information required to identify the element to activate is passed
as parameters to the Intent:

- open_in_immersive
- open_in_immersive_parent_xpath
- open_in_immersive_element_xpath
- a target URL to open
@felipeerias
Copy link
Contributor Author

I have updated the PR so that it uses the XPath of the parent element, which is a more flexible solution.

@HollowMan6 HollowMan6 linked an issue Jan 30, 2024 that may be closed by this pull request
Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

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

I think I told @felipeerias about this in private, but I'll add it here for everybody interested to know. The idea of using an extension is nice, but the problem is that the Chromium backend won't have extensions support initially as it's a lot of work. So provided that we don't have a solution at the moment I'd prioritize one that does not involve extensions.

That said I agree that having an extension that inspects the DOM is likely the best we could do, so I indeed have mixed feelings.

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.

Automatic VR 360 WebXR Open
2 participants