By default, Brave is blocking all 3rd party cookies, which is fine, however, I want to work on a local project which uses LocalStorage but I get the following error.
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
I don't want to turn 3rd party cookie blocking off, which does circumvent the problem, but I'd rather just whitelist local file access (doesn't allow whitelisting file://
protocol).
Is it even possible to get this working without turning off the global "block all 3rd party cookies" setting?
There is 2 ways you can achieve this. Probably also depends how you run your project. I use VS Code and when I run my projects in Brave I got that error. My files were just in a dev directory not in the wwwroot directory.
First option (recommended in my opinion)
Second option (not recommended, as you also stated you don't want to do this)
Hope this helps
You can whitelist file:///*
in brave://settings/content/cookies
Sadly it doesn't seem possible to make this rule more specific to only allow some local web pages access to cookies. And even worse, all local web pages share cookies with each other.
But for testing purposes it should be fine.
Obviously it would make more sense to setup a local web server though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With