diff options
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 4 | ||||
| -rw-r--r-- | lib/utils.coffee | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 6297c729..659acdca 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -122,7 +122,7 @@ class NormalMode extends KeyHandlerMode else if registryEntry.background chrome.runtime.sendMessage {handler: "runBackgroundCommand", frameId, registryEntry, count} else - Utils.invokeCommandString registryEntry.command, [count] + Utils.invokeCommandString registryEntry.command, count installModes = -> # Install the permanent modes. The permanently-installed insert mode tracks focus/blur events, and @@ -153,7 +153,7 @@ initializePreDomReady = -> frameFocused: -> checkEnabledAfterURLChange: checkEnabledAfterURLChange runInTopFrame: ({sourceFrameId, registryEntry}) -> - Utils.invokeCommandString registryEntry.command, [sourceFrameId, registryEntry] if DomUtils.isTopFrame() + Utils.invokeCommandString registryEntry.command, sourceFrameId, registryEntry if DomUtils.isTopFrame() chrome.runtime.onMessage.addListener (request, sender, sendResponse) -> # These requests are intended for the background page, but they're delivered to the options page too. diff --git a/lib/utils.coffee b/lib/utils.coffee index 31f4bec6..7fb6144b 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -11,13 +11,13 @@ Utils = # Takes a dot-notation object string and call the function # that it points to with the correct value for 'this'. - invokeCommandString: (str, argArray) -> + invokeCommandString: (str, args...) -> components = str.split('.') obj = window for component in components[0...-1] obj = obj[component] func = obj[components.pop()] - func.apply(obj, argArray) + func.apply(obj, args) # Escape all special characters, so RegExp will parse the string 'as is'. # Taken from http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex |
