From 074adbab248d577a460d2dd6926a7a76cb413fac Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 6 Oct 2018 15:05:00 +0300 Subject: [PATCH] [BASILISK] Protect against nsIPrincipal.origin throwing for about:blank iframes and custom protocols --- .../basilisk/components/sessionstore/SessionStorage.jsm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/basilisk/components/sessionstore/SessionStorage.jsm b/application/basilisk/components/sessionstore/SessionStorage.jsm index 705139ebfd..7499f95e96 100644 --- a/application/basilisk/components/sessionstore/SessionStorage.jsm +++ b/application/basilisk/components/sessionstore/SessionStorage.jsm @@ -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;