33

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.

2
  • 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.
    – Rodrigo
    Feb 21, 2018 at 14:19
  • @Rodrigo Can anyone help me to answer this question stackoverflow.com/q/60963902/9774964 ? Apr 14, 2020 at 17:23

2 Answers 2

40

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.

11
  • Can this feature be requested from the code? I mean, not requiring the user to go to that preferences view?
    – icordoba
    Jun 21, 2020 at 18:42
  • 5
    @icordoba 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). Jun 22, 2020 at 0:29
  • 5
    Can this screen be accessed for apps added to the home screen? Aug 16, 2020 at 20:44
  • My iPad is having the same problem. Unfortunately, the iOs version is 12.4 and it states up to date 🤷‍♂️
    – BND
    Sep 27, 2020 at 7:13
  • 5
    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. Nov 5, 2020 at 8:21
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.

3

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.