How to permanently allow usage of camera on trusted websites with iOS - Safari
Asked Answered
N

2

36

I'm discovering quaggaJS, a very efficient barcode scanner which I'm implementing on my website. It's using the webcam to scan barcodes.

Is there any way to permanently allow the usage of the webcam on trusted sites with Safari (iOS).

As an example, visiting there demo site, will systematically ask permission to use camera.

I would like to make this choice permanent for visitors of my website.

Nalley answered 18/2, 2018 at 0:48 Comment(2)
Hi Sebastien. As opposed to Chrome under Android, it looks like Safari on iOS does not have an option to permanently save user choice (Cancel | Allow) for camera usage.Sleepless
@Sleepless Can anyone help me to answer this question stackoverflow.com/q/60963902/9774964 ?Bonesetter
L
15

Unfortunately, it seems there is no way to permanently grant a website access to the iPhone camera within Safari (yet).

iOS 11 added the option to completely disable camera & microphone access in the Safari privacy & security settings. Having the camera & microphone access enabled for Safari, however, only means that Safari will ask the user for their permission when a website requests access to the user media.

Unfortunately, as of iOS 11.3, no further website-specific settings are available, so your users would have to confirm their permission every time camera access is needed on your website.

I'd like to reference the corresponding Apple Support page, but this question doesn't seem to be addressed there yet.

Lawler answered 20/4, 2018 at 12:48 Comment(3)
Any news about this?Grove
Can anyone help me to answer this question stackoverflow.com/q/60963902/9774964 ?Bonesetter
This answer is no longer true: the correct answer with iOS 13 is https://mcmap.net/q/420752/-how-to-permanently-allow-usage-of-camera-on-trusted-websites-with-ios-safariStomato
T
46

This is solved from iOS 13 onwards. With any website open, tap the "AA" icon in the top-left. Then tap "Website Settings" which will enable you to set camera permissions to "Allow" instead of "Ask".

Clicking the "AA" label in iOS safari opens a panel which includes "Website Settings" enter image description here

Unfortunately this setting is not available before iOS 13.

From iOS 17 it's also possible to enable the camera permission for all websites (Settings -> Safari -> Camera), although I don't recommend doing this unless you want to give random websites the ability to spy on you through your camera.

Thrilling answered 6/8, 2019 at 2:15 Comment(11)
Can this feature be requested from the code? I mean, not requiring the user to go to that preferences view?Contribution
@Contribution Unfortunately not. I guess Apple is making it difficult for random websites to spy on the user through their camera by requiring permission each time. Requiring additional steps from the user to permanently grant access ensures that the user really trusts the website and knows what they're doing (as opposed to clicking "OK" on a random popup).Thrilling
Can this screen be accessed for apps added to the home screen?Perdue
My iPad is having the same problem. Unfortunately, the iOs version is 12.4 and it states up to date 🤷‍♂️Wingless
@Wingless Is it an old iPad? Eventually Apple prevents older devices from being updated to new iOS versions.Thrilling
@DanielElkington, yeah it is an old iPad. Ok, I see. Strange policy though. I am now stuck in that forever??!!Wingless
For installed PWAs this does not work at all. Also it seems that setting it in Safari for a website does not propagate it to the PWA after install.Ehling
Using iPhone 12 Pro, IOS 15.5, latest chrome, the 'Aa' icon is not there....Lyse
@Lyse The question relates to SafariThrilling
Is this behavior documented in Apple's docs or somewhere else? I've spent some time googling and can't find anything?Microlith
@IvanBanha This is documented by Apple at the bottom of this page support.apple.com/en-gb/guide/iphone/iphb01fc3c85/iosThrilling
L
15

Unfortunately, it seems there is no way to permanently grant a website access to the iPhone camera within Safari (yet).

iOS 11 added the option to completely disable camera & microphone access in the Safari privacy & security settings. Having the camera & microphone access enabled for Safari, however, only means that Safari will ask the user for their permission when a website requests access to the user media.

Unfortunately, as of iOS 11.3, no further website-specific settings are available, so your users would have to confirm their permission every time camera access is needed on your website.

I'd like to reference the corresponding Apple Support page, but this question doesn't seem to be addressed there yet.

Lawler answered 20/4, 2018 at 12:48 Comment(3)
Any news about this?Grove
Can anyone help me to answer this question stackoverflow.com/q/60963902/9774964 ?Bonesetter
This answer is no longer true: the correct answer with iOS 13 is https://mcmap.net/q/420752/-how-to-permanently-allow-usage-of-camera-on-trusted-websites-with-ios-safariStomato

© 2022 - 2025 — McMap. All rights reserved.