PSA: You can use `self.origin` in windows and workers starting in Firefox 54 thanks to @bz_moz.https://bugzilla.mozilla.org/show_bug.cgi?id=1306170 …
I can't speak to the SW case, but for <iframe sandbox src="http://example.com ">, they are quite different.
-
-
Yea, SW are pretty strict and I think `self.location.origin === self.origin` should always be true.
-
Of course, in FF `self.origin` will be faster in workers than location because URL parsing must hit main thread.
- 1 more reply
New conversation -
-
-
Or for an about:blank iframe, for that matter. Or <iframe srcdoc>.
-
So if your semantics are "what is my url?" use location.origin. If they're "what is my origin?" use self.origin.
End of conversation
New conversation -
-
-
That's cool. We're just worried about the SW case in that code.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.