Intent to Deprecate and Remove: document.origin

瀏覽次數:149 次

Philip Jägenstedt

2018年4月16日 上午9:05:562018/4/16


Deprecate document.origin for 2 release cycles and then remove it. self.origin is the replacement, supported in Chrome, Firefox and Safari already.

See previous Intent to Deprecate: document.origin also, where +Mike West did compat analysis.


It's a Blink/WebKit-only API which now has a replacement (self.origin) with wider support, and there's evidence to suggest that web developers have been bitten by this interop problem, see below.

Interoperability and Compatibility Risk

Edge: Not supported, and suggested deprecation/removal

Firefox: Not supported

Safari: Supported, but they also support self.origin.

In the previous intent there was an analysis done, which found 45 potentially legit uses of the attribute. Since then usage has gone up so I did another round on GitHub:

Conclusion is that the "uncategorized" bucket is now ~80, and I've tested a few of them without finding breakage. No doubt something will break, but the httparchive dataset queried had ~460k pages, so 80 is ~0.017% of that.

If there is a problem, I'd anticipate it's because of a large web property using document.origin, in which case we can revert and retry after a while.

Evidence of web developer being bitten: on there's a comment saying "document.origin is not by ie" before some code that does "location.protocol + '//' +".

Alternative implementation suggestion for web developers

Use self.origin (window.origin) it returns the same value.

Usage information from UseCounter

1.5% is a big number, but this counter will be hit by mere access, possibly inflated by mere enumeration of attributes on document, and definitely inflated by usage that won't break at all. See above.

Entry on the feature dashboard

Requesting approval to remove too?


Jochen Eisinger

2018年4月16日 上午9:12:562018/4/16
收件者:Philip Jägenstedt、blink-dev、

You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit

Mike West

2018年4月17日 凌晨3:06:172018/4/17
收件者:Jochen Eisinger、Philip Jägenstedt、blink-dev
LGTM2, thanks for following up on the earlier intent. Sorry for letting that fall through the cracks...

Daniel Bratell

2018年4月24日 上午11:47:022018/4/24
收件者:Jochen Eisinger、Mike West、Philip Jägenstedt、blink-dev

(with the usual caveat that the deprecation period is both a chance for web developers to adapt, and for us to change our minds if the usage is higher than we suspect from probing github)

To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Philip Jägenstedt

2018年9月17日 凌晨4:43:242018/9/17
收件者:Daniel Bratell、Jochen Eisinger、Mike West、blink-dev
Update: the removal has landed now and will be in M71 instead of M70 as planned and claimed by the deprecation message. I've updated but have not merged a change to the deprecation message to M70. (I'm not sure how to do that, unless the deprecation message is changed first in a separate commit, which I didn't do.)
0 則新訊息