webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Incompatible Web Browser on Android 11 Tablet

Open six-edge-ops opened this issue 5 years ago • 9 comments

Describe the bug

Using the Vanilla Vite template on a Samsung Galaxy S7 and latest chrome browser.

Link to the blitz that caused the error

https://stackblitz.com/edit/vitejs-vite-3scisj

Steps to reproduce

  1. Open stackblitz vite vanilla template on a Galaxy S7 tablet running Android 11

Expected behavior

Should be compatible on Android Chrome. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer See: https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated

Screenshots

No response

Platform

Browser name  = Chrome 
Full version  = 96.0.4664.45
Major version = 96
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Linux; Android 11; SM-T733) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 76714720,
  "usedJSHeapSize": 74691680,
  "jsHeapSizeLimit": 907804672
}
Hash = f0f0e35d34e6f38828752db79b041c48b98806b5

Additional context

Would be super awesome if this would work on this tablet as I want to start a new Nuxt project after buying a course in Mastering Nuxt, but unfortunately when I open a new Stackblitz app template for Nuxt it says this browser is not supported, although it seems the required technologies are available in Android Chrome.

six-edge-ops avatar Nov 29 '21 22:11 six-edge-ops

Same issue on Android 12, Pixel 6, Chrome. Some times I like to see and respond to stuff on my phone. CSB does this well enough.

User agent: Mozilla/5.0 (Linux; Android 12; Pixel 6 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4756.0 Mobile Safari/537.36 EdgA/98.0.1107.0

https://tests.caniuse.com/?feat=cors Pass https://tests.caniuse.com/?feat=sharedarraybuffer Pass

I tried to get it working with help of chrome://inspect custom UA feature... to no avail. Screenshot 2021-12-17 19 12 22

FossPrime avatar Dec 17 '21 23:12 FossPrime

Thanks for the report. Could you folks paste the result of:

console.log(navigator.userAgent);
console.log(window.SharedArrayBuffer);
console.log(navigator.serviceWorker);

jrvidal avatar Jan 20 '22 22:01 jrvidal

I setup the chrome remote debugger and confirmed that window.SharedArrayBuffer is not available. After checking the compatibility table again here there is a Asterix in the Chrome Android column stating that SharedArrayBuffer is gated behind COOP/COEP. For more detail, read Making your website "cross-origin isolated" using COOP and COEP...

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#browser_compatibility

image

Quoted from this page: https://developer.chrome.com/blog/enabling-shared-array-buffer/#in-brief

SharedArrayBuffer is currently supported in Firefox 79+, and will arrive in Android Chrome 88. However, it's only available to pages that are cross-origin isolated.

Seems there may be some headers that need to be set to enable the SharedArrayBuffer feature:

Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin

Console output from the remote debugging session from a Galaxy S7 tablet running Android 11:

image

References

  • https://developer.chrome.com/blog/enabling-shared-array-buffer/#in-brief
  • https://developer.chrome.com/blog/enabling-shared-array-buffer/#cross-origin-isolation
  • https://web.dev/coop-coep/

six-edge-ops avatar Jan 22 '22 18:01 six-edge-ops

If you solve this problem for Chrome Android I promise to pay for a membership as this would be amazing if it works on my tablet. I use it in the evening while my computer is sleeping in the bedroom with my daughter. Hmm so I'm stuck with this tablet. I managed to hack the tablet a bit to install VS Code and Node.JS on it using Termux and it works ok, but it's not ideal and a bit clunky. I would love to use stackblitz and when it works I will definitely upgrade to test your GitHub private repos (beta) feature too. Having said that if it's still in beta, I will happily test it for you if you give me a test account ⚡👉😃

six-edge-ops avatar Jan 22 '22 18:01 six-edge-ops

@six-edge Thanks, we do have a limitation in our browser support that prevents SB from running in Chrome mobile. This issue is in our roadmap so I'll keep this updated with our progress, though I can't offer a concrete timeline.

Thanks!

jrvidal avatar Jan 24 '22 20:01 jrvidal

Thanks @jrvidal really looking forward to this working 🚀

six-edge-ops avatar Jan 25 '22 17:01 six-edge-ops

@six-edge FIrefox for Android is real firefox... however it also has the same COEP header requirement as Chrome for Android. It should be relatively easy to run an nginx reverse proxy on the tablet in Termux and search and replace all references to stackblitz.io, then inject the COEP headers. I won't have time to try it this week, but I recon it can be done by a skilled hobbyist in an hour-ish.

FossPrime avatar Jan 26 '22 20:01 FossPrime

This is working now on a Samsung Galaxy S7 Android Tablet!

Amazing! I've been waiting a while for this. Stackblitz team rocks!!!

Screenshot_20220617-230644_Chrome.jpg

six-edge-ops avatar Jun 17 '22 21:06 six-edge-ops

I guess we can close this issue now? Android (Chrome and Firefox) should be supported. Please feel free to create a new issue if something doesn't work correctly.

SamVerschueren avatar Jun 21 '22 12:06 SamVerschueren