Closed Bug 853359 Opened 11 years ago Closed 11 years ago

window.location.replace with file:/// failed with code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.replace]

Categories

(DevTools Graveyard :: Scratchpad, defect)

18 Branch
x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mildred-bug.mozilla, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130109165101

Steps to reproduce:

I ran this code in scratchpad:

    window.location.replace("file:///some/local/file.html");


Actual results:

/*
Exception: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.replace]
@10
*/


Expected results:

Change the window location to the above file:/// url
(like bug 784164)
Component: Untriaged → Developer Tools: Scratchpad
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Actually it's not a duplicate, since I can no longer reproduce the other bug. In Nightly I get the more descriptive:

Exception: Access to 'file:///some/local/file.html' from script denied

This is almost certainly due to the sandbox we are currently using in Scratchpad to avoid polluting the content window.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Bug 825039 should fix this.
Depends on: 825039
bug 825039 doesn't seem to have affected the result. The error seems to be the expected result though no?
No longer depends on: 825039
If you change to Environment > browser, this actually works (and totally breaks the browser, but that's expected). I'm going to call this working as intended. Content JS isn't allowed to open up files on the local filesystem for security reasons.
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → INVALID
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.