aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormrmr19932017-10-25 16:45:45 +0100
committermrmr19932017-10-25 16:51:46 +0100
commitaca953e06a7cf5aa6906df677a8fb6ed3e688a03 (patch)
treef207a026e1e8e97b718aaec98f3e8f7b530af9cf /lib
parent03569d64b445780576f960d0553dc763c807de95 (diff)
downloadvimium-aca953e06a7cf5aa6906df677a8fb6ed3e688a03.tar.bz2
FF: Share |root| global proxy, re-add the globals to window on DOMLoad
This is a workaround for Firefox bug 1408996.
Diffstat (limited to 'lib')
-rw-r--r--lib/clipboard.coffee3
-rw-r--r--lib/dom_utils.coffee3
-rw-r--r--lib/find_mode_history.coffee3
-rw-r--r--lib/handler_stack.coffee3
-rw-r--r--lib/keyboard_utils.coffee3
-rw-r--r--lib/rect.coffee3
-rw-r--r--lib/settings.coffee3
-rw-r--r--lib/utils.coffee5
8 files changed, 18 insertions, 8 deletions
diff --git a/lib/clipboard.coffee b/lib/clipboard.coffee
index af143dd9..1d378e76 100644
--- a/lib/clipboard.coffee
+++ b/lib/clipboard.coffee
@@ -25,5 +25,6 @@ Clipboard =
value
-root = exports ? window
+root = exports ? (window.root ?= {})
root.Clipboard = Clipboard
+extend window, root unless exports?
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index ff5991dc..e771d436 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -416,5 +416,6 @@ DomUtils =
style.textContent = Settings.get "userDefinedLinkHintCss"
document.head.appendChild style
-root = exports ? window
+root = exports ? (window.root ?= {})
root.DomUtils = DomUtils
+extend window, root unless exports?
diff --git a/lib/find_mode_history.coffee b/lib/find_mode_history.coffee
index ff660bd2..93698266 100644
--- a/lib/find_mode_history.coffee
+++ b/lib/find_mode_history.coffee
@@ -46,5 +46,6 @@ FindModeHistory =
refreshRawQueryList: (query, rawQueryList) ->
([ query ].concat rawQueryList.filter (q) => q != query)[0..@max]
-root = exports ? window
+root = exports ? (window.root ?= {})
root.FindModeHistory = FindModeHistory
+extend window, root unless exports?
diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee
index 806b707f..2439f55c 100644
--- a/lib/handler_stack.coffee
+++ b/lib/handler_stack.coffee
@@ -1,4 +1,4 @@
-root = exports ? window
+root = exports ? (window.root ?= {})
class HandlerStack
constructor: ->
@@ -120,3 +120,4 @@ class HandlerStack
root.HandlerStack = HandlerStack
root.handlerStack = new HandlerStack()
+extend window, root unless exports?
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee
index 1a1ea797..681ee139 100644
--- a/lib/keyboard_utils.coffee
+++ b/lib/keyboard_utils.coffee
@@ -101,5 +101,6 @@ KeyboardUtils =
KeyboardUtils.init()
-root = exports ? window
+root = exports ? (window.root ?= {})
root.KeyboardUtils = KeyboardUtils
+extend window, root unless exports?
diff --git a/lib/rect.coffee b/lib/rect.coffee
index d4807cc2..59764d18 100644
--- a/lib/rect.coffee
+++ b/lib/rect.coffee
@@ -91,5 +91,6 @@ Rect =
(rect1, rect2) ->
halfOverlapChecker(rect1, rect2) or halfOverlapChecker rect2, rect1
-root = exports ? window
+root = exports ? (window.root ?= {})
root.Rect = Rect
+extend window, root unless exports?
diff --git a/lib/settings.coffee b/lib/settings.coffee
index 38718990..11cf7557 100644
--- a/lib/settings.coffee
+++ b/lib/settings.coffee
@@ -218,5 +218,6 @@ if Utils.isBackgroundPage()
# be removed after 1.58 has been out for sufficiently long.
Settings.nuke "copyNonDefaultsToChromeStorage-20150717"
-root = exports ? window
+root = exports ? (window.root ?= {})
root.Settings = Settings
+extend window, root unless exports?
diff --git a/lib/utils.coffee b/lib/utils.coffee
index d0a82cf7..b5b96844 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -335,8 +335,11 @@ class JobRunner
onReady: (callback) ->
@fetcher.use callback
-root = exports ? window
+root = exports ? (window.root ?= {})
root.Utils = Utils
root.SimpleCache = SimpleCache
root.AsyncDataFetcher = AsyncDataFetcher
root.JobRunner = JobRunner
+unless exports?
+ root.extend = extend
+ extend window, root