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

Your browser does not seem to support WebGL #3414

Open
CandidlyRed opened this issue Apr 25, 2024 · 0 comments
Open

Your browser does not seem to support WebGL #3414

CandidlyRed opened this issue Apr 25, 2024 · 0 comments

Comments

@CandidlyRed
Copy link

Bug description:
When running html with javascript that requires WebGL, browser on phone gives the error "Your browser does not seem to support WebGL"

To Reproduce:

<WebView originWhitelist={['*']} source={{ html:


      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core/index.min.css" />
      <style>
          html, body {
              margin: 0;
              padding: 0;
              height: 100%;
              overflow: hidden; /* Hide scroll bars */
          }

          #viewer {
              width: 100%;
              height: 100%;
              margin: 0;
              padding: 0;
          }

      </style>
  </head>

  <!-- the viewer container must have a defined size -->
  <div id="viewer" style="width: 100%; height: 100%;"></div>

  <script type="importmap">
      {
          "imports": {
              "three": "https://cdn.jsdelivr.net/npm/three/build/three.module.js",
              "@photo-sphere-viewer/core": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core/index.module.js"
          }
      }
  </script>

  <script type="module">
      import { Viewer } from '@photo-sphere-viewer/core';

      const viewer = new Viewer({
          container: document.querySelector('#viewer'),
          panorama: 'https://picsum.photos/4000/3000',
          navbar: null,
      });
  </script>
  ` }} style={{ flex: 1 }} />`

Above is an example of a webview that uses html with a script that requires WebGL, when running it in the App, I get the error "Your browser does not seem to support WebGL"

Expected behavior:

My HTML runs fine in browser on my computer, but it fails to run in the webview on my phone. I'm not sure if this is unsupported, or if there's some kind of workaround available. I saw some previous issues that were closed- but there didn't seem to be a solution

Screenshots/Videos:

Screenshot_20240425_002009_monogatari
Ignore the back button, that is a component rendered without webview

Environment:

  • OS: MacOS
  • OS version:
  • react-native version: 0.73.7
  • react-native-webview version: ^13.8.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant