summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2018-10-06 15:05:00 +0300
committerJustOff <Off.Just.Off@gmail.com>2018-10-06 15:05:00 +0300
commit0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c (patch)
tree3456f7085b0374574c3601c92d361f8166157c4c
parent8860eddcee1417483cafd114f3a9ec127e0f1f74 (diff)
downloadUXP-0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c.tar
UXP-0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c.tar.gz
UXP-0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c.tar.lz
UXP-0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c.tar.xz
UXP-0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c.zip
[BASILISK] Protect against nsIPrincipal.origin throwing for about:blank iframes and custom protocols
-rw-r--r--application/basilisk/components/sessionstore/SessionStorage.jsm9
1 files changed, 8 insertions, 1 deletions
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;