Brave-browser: Brave Shields not disabling under local html files (reopen)

Created on 2 Oct 2019  路  7Comments  路  Source: brave/brave-browser

Description

(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

  1. Open Brave Browser
  2. Go to brave://settings and set Brave Shields Defaults -> Cookie Control to "Block 3rd Party Cookies"
  3. 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>
  1. 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.

ODesktop featurshields prioritP3

Most helpful comment

Same issue here. I've been using a custom homepage/new tab page. can no longer store settings in localStorage when opening the file with file://

All 7 comments

Same issue here. I've been using a custom homepage/new tab page. can no longer store settings in localStorage when opening the file with file://

+1 from @tsao-chi1 via https://github.com/brave/brave-browser/issues/7085

Description

cannot remove site settings on local file
site settings on local file not working

Steps to Reproduce

  1. block script
  2. open a file file:///C:/Program%20Files/Racket/doc/index.html
  3. Always allow Javascript

    1. Countinue blocking Javascript

Actual result:

cannot remove rule file:///C:/Program%20Files/Racket/doc/index.html

cc: @tomlowenthal @rebron for prioritization

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).

+1

All I am doing is
if(window.localStorage)

in a static html file and I got an exception. It works if in shield I set "Allow all cookies". Can't figure out how to allow it in "cookies and site data".

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bsclifton picture bsclifton  路  3Comments

jonathansampson picture jonathansampson  路  3Comments

bbondy picture bbondy  路  3Comments

kjozwiak picture kjozwiak  路  3Comments

AlexCombas picture AlexCombas  路  3Comments