[BASILISK] Protect against nsIPrincipal.origin throwing for about:blank iframes and custom protocols

This commit is contained in:
JustOff 2018-10-06 15:05:00 +03:00 committed by Roy Tam
commit 074adbab24

View file

@ -74,7 +74,14 @@ var SessionStorageInternal = {
// Get the origin of the current history entry
// and use that as a key for the per-principal storage data.
let origin = principal.origin;
let origin;
try {
// The origin getter may throw for about:blank iframes as of bug 1340710,
// but we should ignore them anyway. The same goes for custom protocols.
origin = principal.origin;
} catch (e) {
return;
}
if (visitedOrigins.has(origin)) {
// Don't read a host twice.
return;