Closed Bug 1230624 Opened 9 years ago Closed 8 years ago

using a relative or invalid path in clients.openWindow() should throw a TypeError


(Core :: DOM: Push Subscriptions, defect)

Not set





(Reporter: edwong, Assigned: wchen)


(Blocks 1 open bug)


1. go here:
2. unregister if SW already exists and refresh
3. select sw-focus-bug.js then install, subscribe, then xhr
4. click on the notification

actual: you should see a TypeError caught or printed to browser console.

expected: no exception
spec says:

Let url be the result of parsing url with entry settings object's API base URL.
If url is failure, return a promise rejected with a TypeError.
If url is about:blank, return a promise rejected with a TypeError.
If this algorithm is not allowed to show a popup, return a promise rejected with an "InvalidAccessError" exception.
William said he'd get to this so assigning to him.
Assignee: nobody → wchen
This bug looks invalid. The test script has a couple bugs, I get a reference error after clicking on the notification and the script also calls client.focus with a URL argument, but that function doesn't take a URL argument. The steps you have listed in comment 1 are from the openWindow algorithm but the script doesn't call that anywhere.

We do return TypeError for invalid URLs:

I tested this by trying to openWindow on "about:blank" and an invalid URL ("http://[invalid"), in both cases I got TypeError.
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.