Skip to content

Commit 42801cd

Browse files
diracdeltasdfperry5
authored andcommitted
Fix getOrigin to work with muon.url.parse
Fix brave#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.
1 parent 3e64d88 commit 42801cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

js/lib/urlutil.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,14 @@ const UrlUtil = {
429429
}
430430

431431
let parsed = urlParse(location)
432+
if (parsed.origin) {
433+
// parsed.origin is specific to muon.url.parse
434+
return parsed.origin.replace(/\/+$/, '')
435+
}
432436
if (parsed.host && parsed.protocol) {
433437
return parsed.slashes ? [parsed.protocol, parsed.host].join('//') : [parsed.protocol, parsed.host].join('')
434-
} else {
435-
return null
436438
}
439+
return null
437440
}
438441
}
439442

0 commit comments

Comments
 (0)