From c8fa3c5351462fc043c3bbb5c34c10e9c25dbe00 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Mon, 13 Jun 2016 07:59:29 +0200 Subject: [PATCH] Fix opening links in new tabs in Firefox 50 `ContentClick.contentAreaClick` now requires passing `originAttributes` in order not to crash. This affected `f`, `af`, `F` and `gf`. See https://hg.mozilla.org/mozilla-central/rev/07dc0094e76f Supersedes and closes #758. Thanks to @XrXr for finding the problem and suggesting a fix! --- extension/lib/commands.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extension/lib/commands.coffee b/extension/lib/commands.coffee index 31cd591..c2912a5 100644 --- a/extension/lib/commands.coffee +++ b/extension/lib/commands.coffee @@ -482,6 +482,7 @@ helper_follow_clickable = (options, {vim, count = 1}) -> {type, elementIndex} = marker.wrapper isLast = (timesLeft == 1) isLink = (type == 'link') + {window} = vim switch when keyStr.startsWith(vim.options.hints_toggle_in_tab) @@ -502,7 +503,7 @@ helper_follow_clickable = (options, {vim, count = 1}) -> vim._focusMarkerElement(elementIndex) if inTab - utils.nextTick(vim.window, -> + utils.nextTick(window, -> # `ContentClick.contentAreaClick` is what Firefox invokes when you click # links using the mouse. Using that instead of simply # `gBrowser.loadOneTab(url, options)` gives better interoperability with @@ -513,6 +514,7 @@ helper_follow_clickable = (options, {vim, count = 1}) -> shiftKey: not inBackground ctrlKey: true metaKey: true + originAttributes: window.document.nodePrincipal?.originAttributes ? {} }, vim.browser) reset() ) -- 2.39.3