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

Device.getInfo() - Failed to read localStorage #172

Closed
pechisworks opened this issue Jan 4, 2021 · 3 comments
Closed

Device.getInfo() - Failed to read localStorage #172

pechisworks opened this issue Jan 4, 2021 · 3 comments
Labels

Comments

@pechisworks
Copy link

Bug Report

Plugin(s)

Device

Capacitor Version

Capacitor 2.4.2

Platform(s)

Web - when localStorage is not allowed, like Facebook Instant Games.

Current Behavior

await Device.getInfo() gives following error message.

SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Error: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

This error occurs because capacitor is trying to save the generated uuid to localStorage.

Expected Behavior

Capacitor should check whether localStorage is available and writeable.
It should return the DeviceInfo without an uuid.

Code Reproduction

  1. Disable localStorage
  2. Run await Device.getInfo()
@Paso
Copy link

Paso commented May 31, 2022

Also happens when in WebView that hasn't enabled storage, such as Twitters in app browser. This should mean that it is a fairly common occurrence.

/edit on Android that is

@jcesarmobile
Copy link
Member

this has been fixed in 4.0.0 beta 0

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants