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

Fix getOrigin to work with muon.url.parse #10407

Merged
merged 1 commit into from
Aug 10, 2017
Merged
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
7 changes: 5 additions & 2 deletions js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,14 @@ const UrlUtil = {
}

let parsed = urlParse(location)
if (parsed.origin) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at some point in the near future we should convert to chromium urls with a trailing /. Removing them for backwards compat is sure to create problems in the long-term

// parsed.origin is specific to muon.url.parse
return parsed.origin.replace(/\/+$/, '')
}
if (parsed.host && parsed.protocol) {
return parsed.slashes ? [parsed.protocol, parsed.host].join('//') : [parsed.protocol, parsed.host].join('')
} else {
return null
}
return null
}
}

Expand Down