If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

URL instances should inherit api signature of window.location

RESOLVED FIXED

Status

Add-on SDK
General
P3
normal
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: erikvold, Assigned: jsantell)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug])

Attachments

(1 attachment)

https://bugzilla.mozilla.org/show_bug.cgi?id=861084#c2

https://developer.mozilla.org/en-US/docs/DOM/window.location
Summary: URL instances should inherit structure of window.location → URL instances should inherit api signature of window.location
Whiteboard: [good first bug]

Updated

5 years ago
Priority: -- → P3
Just a note, `Location`'s implementation for `host` is hostname + por, whereas our currently implementation of `host` is `Location`'s `hostname`
(Assignee)

Updated

4 years ago
Assignee: nobody → jsantell
Erik, is this what you had in mind? Also this would complete #861084 as well
https://github.com/jsantell/addon-sdk/commit/31fb98f10cee787118b39e93c31853384e3906ce
Flags: needinfo?(evold)
Created attachment 747125 [details]
GH Pull Request 991
Attachment #747125 - Flags: review?(evold)
Comment on attachment 747125 [details]
GH Pull Request 991

Looks great to me, we should get Irakli's approval tho
Attachment #747125 - Flags: review?(evold)
Attachment #747125 - Flags: review+
Attachment #747125 - Flags: feedback?(rFobic)
Flags: needinfo?(evold)
window.location does not implements `tld` property and I don't think we should add it. Instead we should define `getTDL(urlString)` function to the module.
Attachment #747125 - Flags: feedback?(rFobic) → feedback-
Other than that it looks fine by me.
As a side note [nsIURLParser](https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIURLParser) maybe a better way to parse URLs than regexp replace.

Comment 8

4 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/c32dcc5617073d75c31b552cb5292016cab31952
Bug 864658, URL API should have same properties as window.location, also
fixes bug 861084

https://github.com/mozilla/addon-sdk/commit/86fb910bdcf8d5dcc9f5dd3bb6db80030c640b10
Merge pull request #991 from jsantell/url-matches-window-location

Fix Bug 864658, URL API should have same properties as window.location, also fixes bug 861084 (getTLD method) r+=@erikvold

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Comment 9

4 years ago
Commits pushed to integration at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/c32dcc5617073d75c31b552cb5292016cab31952
Bug 864658, URL API should have same properties as window.location, also

https://github.com/mozilla/addon-sdk/commit/86fb910bdcf8d5dcc9f5dd3bb6db80030c640b10
Merge pull request #991 from jsantell/url-matches-window-location
Depends on: 875812
You need to log in before you can comment on or make changes to this bug.