From 0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 6 Oct 2018 15:05:00 +0300 Subject: [BASILISK] Protect against nsIPrincipal.origin throwing for about:blank iframes and custom protocols --- application/basilisk/components/sessionstore/SessionStorage.jsm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'application') diff --git a/application/basilisk/components/sessionstore/SessionStorage.jsm b/application/basilisk/components/sessionstore/SessionStorage.jsm index 705139ebf..7499f95e9 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; -- cgit v1.2.3