Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Update history.js #1187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ class Location {
toString() {
return this._url;
}

toJSON() {
return {
hostname: this.hostname,
href: this.href,
origin: this.origin,
hash: this.hash,
host: this.host,
pathname: this.pathname,
port: this.port,
protocol: this.protocol,
search: this.search
}
}

get hostname() {
return URL.parse(this._url).hostname;
Expand Down