summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-10-06 19:34:45 +0200
committerGitHub <noreply@github.com>2018-10-06 19:34:45 +0200
commit323cb98de19b6f63b52d3fde5d7144712384c058 (patch)
tree02f34db512b5c3b5b0f6f4a1f8180b3763d3a927
parent866ea8dfa55f531fa7951f41db881c51ad6f143d (diff)
parent0c3479b8ba7efe02d8ad2827c51c0dcb1f67698c (diff)
downloadUXP-323cb98de19b6f63b52d3fde5d7144712384c058.tar
UXP-323cb98de19b6f63b52d3fde5d7144712384c058.tar.gz
UXP-323cb98de19b6f63b52d3fde5d7144712384c058.tar.lz
UXP-323cb98de19b6f63b52d3fde5d7144712384c058.tar.xz
UXP-323cb98de19b6f63b52d3fde5d7144712384c058.zip
Merge pull request #813 from JustOff/PR_SessionStorage_principal_origin
[BASILISK] Protect against nsIPrincipal.origin throwing for about:blank iframes and custom protocol urls
-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;