Notbad
Notbad

Reputation: 6296

Why electron apps does not have localStorage object when accesed from development tools? (Ctrl-Shift-I)

I'm trying to access some data that is presented in discord app to write it to disc. Because I'm going to do that without human supervision every x seconds, I have thought of using localStorage to store this data, but It seems I can't access this object from the console. I get a localStorage is not defined error. I also tried windows.localStorage without any luck either.

Is there any way to achieve this from a electro app dev console?

Here a picture of the problem: enter image description here

Cheers.

Upvotes: 2

Views: 20327

Answers (1)

Shivratna Kumar
Shivratna Kumar

Reputation: 1311

I guess you misspelled it. You should be able to access the localStorage as window.localStorage and an item 'X' inside it as, localStorage.getItem('X').

Attaching a screenshot of localStorage accessed in the console.

enter image description here

Error Scenario screenshot

enter image description here

Upvotes: 5

Related Questions