New issue
Advanced search Search tips

Issue 623505 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Reading local files without user interaction, chrome.tabs.create('file:///'), bug or feature?

Reported by willmake...@gmail.com, Jun 27 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0

Steps to reproduce the problem:
1. Create a background.js with following content: setTimeout(() => { chrome.tabs.create({ "url": "file:///etc"}, () => { console.log('done'); } ); }, 10000);
2. Create manifest.json:
{
    "name": "myExtension",
    "version": "0.1",
    "description": "Description",
    "permissions": [ "tabs" ],
    "background": {"scripts": ["background.js"]},

    "manifest_version": 2
}
3. Install extension in "Developer mode".

What is the expected behavior?
Exception (error) something like - "Error: URL not allowed: file:///etc"

What went wrong?
Reading the file without user interaction.
The browser should read only those files (directories) that are specified directly by the user, for example, through opening dialogue.

WebStore page: 

Did this work before? N/A 

Chrome version: 50.0.2661.94  Channel: stable
OS Version: 
Flash Version: 

The same code in Firefox will produce the following error - Unchecked lastError value: Error: URL not allowed: file:///etc
 

Comment 1 by mmenke@chromium.org, Jun 27 2016

Components: -Platform>Extensions Platform>Extensions>API

Comment 2 by phistuck@gmail.com, Jul 1 2016

Like I wrote in the discussion - you cannot read the data from that file, you can only make the browser show it (or download it).
If you check that checkbox for file access on chrome:extensions, you can read it. Otherwise, it is opaque to the extension.
Status: WontFix (was: Unconfirmed)
The user has to opt in to allowing file:// urls for each extension on the chrome://extensions page. 

Sign in to add a comment