The documentURI read-only property of the Document interface returns the document location as a string.
documentURI
MDN Reference