Brave Shields not disabling under local html files (reopen)
See original GitHub issueDescription
(Reopen due to posting previous issue on an earlier release, but still seem to have the issue)
After developing a web application offline using localStorage, I got an error from the console, disallowing my web app to read/write to localStorage, but then after going to Brave Settings and setting Cookie Control from “block 3rd party cookies” to “Allow all Cookies”, my program started working.
I was unable to use the Brave Shields icon in the URL bar to allow all cookies because the icon was disabled, most likely because I was viewing an html file locally on my computer. I believe the disabled icon was supposed to mean that the shields were disabled, even though they actually were not.
Steps to Reproduce
- Open Brave Browser
- Go to brave://settings and set Brave Shields Defaults -> Cookie Control to “Block 3rd Party Cookies”
- Create an html file (call it doc.html) locally with this script using localStorage:
<!doctype HTML>
<html>
<head>
<title>Test</title>
<script>
if (typeof(Storage) !== "undefined") {
localStorage.setItem("hello", "world");
}
</script>
</head>
<body>
</body>
</html>
- Open that html file with Brave Browser
Actual result:
Open the console (ctrl-shift-C -> ‘Console’ tab) and observe the error:
Uncaught DOMException: Failed to read the ‘localStorage’ property from ‘Window’: Access is denied for this document.
The 3rd party cookie blocking on brave shield defaults prevents a local html file from writing to localStorage, even though it appears that Brave Shields should be disabled according to the disabled Brave Shields icon to the far right of the URL bar.
Expected result:
Expected Brave Shields to be disabled and allow localStorage to be written.
Reproduces how often:
Every time.
Brave version (brave://version info)
Brave | 0.68.142 Chromium: 77.0.3865.90 (Official Build) (64-bit) Revision | 58c425ba843df2918d9d4b409331972646c393dd-refs/branch-heads/3865@{#830} OS | Windows 8.1 (Build 9600)
Version/Channel Information:
I only tested it on the official release.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top GitHub Comments
Any chance of a fix for this because all the HTML reports I generate and receive as local files I am forced to have to use Microsoft Edge to open them.
I also can reproduce this issue using local HTML files. I was unable to discover any means of working around this issue through the Site Settings nor through trying to modify Brave Shields’ settings (other than enabling third party cookies across the board).