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

ScreenFull not working in iOS Chrome #164

Closed
adnanrafique opened this issue Dec 24, 2019 · 23 comments · Fixed by #185
Closed

ScreenFull not working in iOS Chrome #164

adnanrafique opened this issue Dec 24, 2019 · 23 comments · Fixed by #185

Comments

@adnanrafique
Copy link

Whenever I try to open my application in fullscreen it shows following error in console.

TypeError: undefined is not an object (evaluating 'screenfull__WEBPACK_IMPORTED_MODULE_23__["raw"].fullscreenchange')

Now I know it does not work with safari on iPhone but It should work on Chrome and I am testing it in chrome.

In the following condition,

if (screenfull.enabled) {} => console.log(screenfull) => true //it should return an object This is the line where it is getting failed.

@sindresorhus
Copy link
Owner

I think this is a problem with your Webpack config and not this package.

It works fine without Webpack: https://github.com/sindresorhus/screenfull.js/blob/38eeb420efaf0011e423fe761be18b0052c900c5/index.html#L158

@adnanrafique
Copy link
Author

Any Idea how I can resolve this?

@Beraliv
Copy link

Beraliv commented Jan 17, 2020

Any Idea how I can resolve this?

Can you show your example? @adnanrafique
Also stand would be perfect to check

@VincentCharpentier
Copy link

This is not really a bug, more like a bad feature from Apple.
The fullscreen API works on iPad but not on iPhone (http://caniuse.com/#feat=fullscreen)

there is no way to switch to fullscreen on IOS >=10 in Safari and Chrome. It is because the Fullscreen API is not supported
https://stackoverflow.com/a/46544156/3484498

Why ?
IMHO, Apple isn't thrilled by PWA and try to limit their adoption. Thus forcing devs to release apps on their marketplace which translate into big $ for them

@kevindecapite
Copy link

kevindecapite commented Apr 10, 2020

The demo on the homepage does not work on iPad (iOS 13.3.1) with Chrome 80.0.3987.95.

I just tested on my iPad and... nothing:
https://sindresorhus.com/screenfull.js/

@shubhamcompro
Copy link

@adnanrafique is it working on IOS safari(iphone) for you?

@iamjoeker
Copy link

I'm seeing the same thing. On latest iPadOS, the demo:

  1. Works in Safari
  2. Does not work in Chrome
  3. Does not work in FireFox

@hubery3721
Copy link

Is any solution?

@mustafaekim
Copy link

When I visit the demo page, I see that it does not work for both Safari and Chrome on an IPAD, 7th generation, IOS 13.5.1

Any idea why it does not work on IPAD? Here it says that fullscreen API is supported on IPAD

@Shaker-Hamdi
Copy link

I'm having this issue, any solution yet?

@mustafaekim
Copy link

@Shaker-Hamdi what I've found out are as below

  • if you click a click on - say a google doc, the link is opened inside the google doc shell. Even though it uses Safari, fullscreen does not work. However if you visit the same link by copying and pasting into the safari browser, it works!
  • second thing to check is to ensure that you are requesting the desktop site

@Shaker-Hamdi
Copy link

@mustafaekim I'm not sure I follow, I'm only looking to trigger fullscreen on an element on the page, and it works in Safari iPad, but not Chrome for some reason.

@kkgo2018
Copy link

if (/ Version/5.1(?:.\d+)? Safari//.test(navigator.userAgent)) {
elemrequest;
} else {
if (keyboardAllowed) {
elemrequest;
} else {
elem[request]({ navigationUI: "auto" });
}
// elem[request](keyboardAllowed && Element.ALLOW_KEYBOARD_INPUT);
}

@kofifus
Copy link

kofifus commented Sep 28, 2020

@kkgo2018 is that a fix ? where does this go and what does it do please ?

@droid95
Copy link

droid95 commented Nov 9, 2020

Same issue here, is not working on iPhone 11 Pro Max browser safari 14 and chrome 86.0.4240.93.

@CaelanStewart
Copy link

Same issue here - still isn't working.

@PaTiToMaSteR
Copy link

player.webkitEnterFullscreen();

@Richienb
Copy link
Contributor

@sindresorhus screenfull.js only works in Safari on iPad:

iPad Pro 12.9 2020 running iOS 14.0 on Browserstack

It does not work on Chrome or Safari on iPhone and Chrome on iPad.

This is because these browsers don't support fullscreen mode. We should add a link to the caniuse page for the Full Screen API in the readme.

@sindresorhus
Copy link
Owner

There already is: https://github.com/sindresorhus/screenfull.js#support

I personally think it's already pretty clear, but PR welcome if you think it can be made clearer.

@nick-w-m
Copy link

Hey! Looking for clarification about this issue. Does no support mean isEnabled will be set to false on iOS, or does it mean the imported code will error out and not initialize successfully?

@Richienb
Copy link
Contributor

.isEnabled appears to be false:

Screenshot of the screenfull.js demo showing that isEnabled is false

@nick-w-m
Copy link

@Richienb Cool! Thanks for the clarification!

@khenriksson
Copy link

I had the same problem with screenfull.isEnabled not working in Safari on iPad. The only workaround was to use controls={true} to get the native "fullscreen" button visible.

andresgutgon added a commit to andresgutgon/community-maps-builder that referenced this issue Oct 1, 2022
We use a JS packages called `screenfull`. It's used to interact with
browser Fullscreen API.
The problem as explained in this issue it's that iOS fails to even load
it:
sindresorhus/screenfull#164

The fix is to try catch before showing full screen button.
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 a pull request may close this issue.