Intent to Implement and Ship: `self.origin`

45 views
Skip to first unread message

Mike West

unread,
Feb 9, 2017, 5:43:21 AM2/9/17
to blink-dev

Contact emails

mk...@chromium.org

Spec

https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin


Summary

`self.origin` returns the Unicode serialization of the origin of the settings object of the global represented by `self` (a Window or WorkerGlobalScope).  This gives scripts a consistent way of getting their origin in both situations.  Note that unlike `location.origin` this represents the actual origin of the global, not the origin of the URL it's loaded from.  The difference can be substantial in the case of sandboxing, for example.

In the window case, this returns the same thing as `self.document.origin`.

Motivation

We don't currently expose origin information inside workers; we should. This is a bit duplicative with `document.origin` in the `Window` case, but provides a stable accessor for all contexts going forward, and allows code reuse between Workers and Windows.


Interoperability and Compatibility Risk


Edge: No signals

Firefox: Intent to ship: https://groups.google.com/d/msg/mozilla.dev.platform/B4F7jCC9jAI/A2c8c7_zBAAJ

Safari: No signals


Ongoing technical constraints

None


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


OWP launch tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=690195


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/6491882200760320


Requesting approval to ship?

Yes


-mike

Jochen Eisinger

unread,
Feb 9, 2017, 7:04:16 AM2/9/17
to Mike West, blink-dev
lgtm1

Dimitri Glazkov

unread,
Feb 9, 2017, 10:20:55 AM2/9/17
to Jochen Eisinger, Mike West, blink-dev
lgtm2

Philip Jägenstedt

unread,
Feb 9, 2017, 10:35:14 AM2/9/17
to Dimitri Glazkov, Jochen Eisinger, Mike West, blink-dev
lgtm3, cool to see it happening at the same time in Blink and Gecko, and using the same tests!
Reply all
Reply to author
Forward
0 new messages