How to grant access in Files and Folders in Catalina for Chrome

catalinafindergoogle-chromeprivacy

Background:
I was debugging a web app and discovered my browser file upload was no longer working in Chrome 80, but works fine in Safari: when I clicked the 'Browse…' button on the web page, the file browsing dialog did not appear as expected. Catalina version is 10.15.3.

I discovered that the same issue was present in Jira, although it was possible to upload files using drag and drop in that case, hence it was not specific to my code.

Although I initially suspected Chrome 80, after trying in different OS (High Sierra, Windows Server 2012), it appears to be specific to Catalina and related to the Catalina -> System Preferences -> Privacy -> Files and Folders settings: Chrome was listed in the 'Files and Folders' panel with access to Documents, but nothing else. Although the '-' option is enabled, the '+' option is greyed out. I clicked the '-' and Chrome was removed from the list and I am not able to restore access to Chrome.

I am able to grant Full Disk Access, but that seems like a bad idea for a web browser as it would undermine this security feature where it is most desirable.

How do I grant access to specific Files and Folders for Chrome?
Why is the '+' button greyed out, even though I have unlocked the padlock?

Best Answer

I found a workaround by triggering Chrome to add my Documents folder to Security and Privacy:

Initially, Chrome had no access granted in System Preferences -> Security & Privacy -> Privacy tab -> 'Files and Folders', nor in 'Full Disk Access'.

I have an HTML file 'index.html' in my Documents folder.

  1. Open a Terminal and run the command:

    open ~/Documents/index.html
  2. Chrome is my default browser, hence tries to open the HTML file

  3. Chrome displays the following dialog box: Google Chrome would like to access files

  4. After granting permissions and opening the file, we can see in System Preferences that Chrome now has access to Documents.
    Catalina System Preferences In addition, my web page with the RFC1867 'Browse...' file upload button now works as expected.