3

So my question is somewhat related to Firefox SecurityError: "The operation is insecure.". Uploading image works on all browsers expect Firefox Android App, It throws SecurityError. I am not able to understand how this is CORS issue. The image is just read from the FileReader and displayed in the UI.

reader.onload = (e) => {
    this.displayImage(e.target.result, file.name);
    this.toggleUploadInput();
  };
  reader.onerror = (e) => {
    alert('error:'+ e.target.error.name);
  };

Any help will be appreciated. Thanks.

Community
  • 1
  • 1
Rahul Dhawani
  • 83
  • 1
  • 7

2 Answers2

3

Solved, the Firefox didn't have the total access to the camera, mic .. You must make sure that it has access to all your device's resources that it is asking for.

  • It actually can access the gallery, camera. So, I am guessing it's not related to asking permissions. Only the image is not sent back to FileReader – Rahul Dhawani Oct 14 '16 at 08:56
  • Can you tell me what's your Android version ? When I said all the access I mean all the access, camera, mic, gallery, gps .. Anything it is asking for, this is the thing that I did to fix the same problem (when the fileReader have this security issues) – Trabelsi Mohamed Hedi Oct 14 '16 at 09:25
  • My android version is 6.0.1 . How did you solve the problem? Is there any way to ask permission implicitly (by prompting, not through settings)? – Rahul Dhawani Oct 15 '16 at 11:43
  • 1
    No, I don't think that there is a way to ask the permission in your web app, but as I said you can manage that in the application's manager in your android settings and that's what I did to solve this problem. – Trabelsi Mohamed Hedi Oct 17 '16 at 07:43
  • To be exact, the permission we needed is for **Storage**. By default, firefox doesn't ask permission to access storage. If we try to download a file, it will ask for permission. After that its working fine. – Murali Manohar Jul 06 '17 at 11:37
-2

I gust go in the Firefox permissions and see this android screenshot

Then I turn on memory access and my script start work nice. As I remember I give all access to Firefox, but don't know why it's don't turn on(