From e6a529ea00033d44226581c48df4e84f4cb80237 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 15 Aug 2017 19:53:35 +0100 Subject: FF: Simulate default action for clicking links with link hints --- background_scripts/main.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 379239ae..eeda263a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -106,6 +106,7 @@ TabOperations = index: request.tab.index + 1 active: true windowId: request.tab.windowId + tabConfig.active = request.active if request.active? # Firefox does not support "about:newtab" in chrome.tabs.create. delete tabConfig["url"] if tabConfig["url"] == Settings.defaults.newTabUrl chrome.tabs.create tabConfig, (tab) -> -- cgit v1.2.3 From 7fa22da6954d28dbd578b0cd490ada638d98b373 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Thu, 21 Sep 2017 21:46:39 +0100 Subject: Add openUrlInNewWindow command --- background_scripts/main.coffee | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index eeda263a..8afecd4f 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -117,6 +117,16 @@ TabOperations = catch callback.apply this, arguments + # Opens request.url in new window and switches to it. + openUrlInNewWindow: (request, callback = (->)) -> + winConfig = + url: Utils.convertToUrl request.url + active: true + winConfig.active = request.active if request.active? + # Firefox does not support "about:newtab" in chrome.tabs.create. + delete tabConfig["url"] if tabConfig["url"] == Settings.defaults.newTabUrl + chrome.windows.create winConfig, callback + toggleMuteTab = do -> muteTab = (tab) -> chrome.tabs.update tab.id, {muted: !tab.mutedInfo.muted} @@ -416,6 +426,7 @@ sendRequestHandlers = # with Chrome-specific URLs like "view-source:http:..". getCurrentTabUrl: ({tab}) -> tab.url openUrlInNewTab: (request) -> TabOperations.openUrlInNewTab request + openUrlInNewWindow: (request) -> TabOperations.openUrlInNewWindow request openUrlInIncognito: (request) -> chrome.windows.create incognito: true, url: Utils.convertToUrl request.url openUrlInCurrentTab: TabOperations.openUrlInCurrentTab openOptionsPageInNewTab: (request) -> -- cgit v1.2.3