The origin
read-only property of the Window
interface returns the origin of the global scope, serialized as a string.
A string.
ExamplesExecuted from inside window scope, the following snippet will log the document's global scope's origin to the console.
console.log(window.origin); // On this page returns 'https://developer.mozilla.org'
If the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e., via file://
URL), origin
will return the string "null"
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3