Parth Agrawal
Parth Agrawal

Reputation: 73

Get the local directory path of the app where web app is loaded

Can I get the path of chrome/Mozilla where my web app is loaded which is created in react can fetch the local directory path of the app(Chrome/Mozilla etc)? Because I want to store the data of website on that location.

Like if I am browsing on Chrome, then I get the path of chrome where it is stored in the local directory.

Upvotes: 1

Views: 163

Answers (1)

Mohamed Mufeed
Mohamed Mufeed

Reputation: 1580

You cannot browse through the client’s machine using javascript. It would be a major security flaw if you could do that. Just think, someone from the internet having access to your local files! If you are looking to store some data persistantly on the client side you can use.

  • cookie
  • localStorage
  • indexDB
  • sessionStorage

Thats pretty much it.

Upvotes: 2

Related Questions