From 1aeaa8dfdc862ec9839a67fb131f841b744d0aaa Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 18 Feb 2018 09:28:32 +0000 Subject: Fix Settings failure in Firefox iframes. This was failing in iframes in Firefox (causing all sorts of other stuff to fail). --- lib/settings.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/settings.coffee b/lib/settings.coffee index fd1ef268..4bfbcbf4 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -11,7 +11,8 @@ # In all cases except Settings.defaults, values are stored as jsonified strings. # If the current frame is the Vomnibar or the HUD, then we'll need our Chrome stubs for the tests. -window.chrome ?= window.top?.chrome +# We use "try" because this fails within iframes on Firefox (where failure doesn't actually matter). +try window.chrome ?= window.top?.chrome storageArea = if chrome.storage.sync? then "sync" else "local" -- cgit v1.2.3