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

Commit

Permalink
Fix getOrigin to work with muon.url.parse
Browse files Browse the repository at this point in the history
Fix #10391

Test Plan:
1. go to google.com
2. click 'remember this decision' and 'deny' when it asks for your location
3. close tab, open google.com again. it should not ask to see your location.
  • Loading branch information
diracdeltas committed Aug 10, 2017
1 parent 78a92da commit 99ac570
Showing 1 changed file with 5 additions and 2 deletions.
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) {
// 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

0 comments on commit 99ac570

Please sign in to comment.