aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/commands.coffee2
-rw-r--r--background_scripts/main.coffee9
2 files changed, 10 insertions, 1 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index f3ae3bd9..0573b9c1 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -336,7 +336,7 @@ commandDescriptions =
scrollFullPageDown: ["Scroll a full page down"]
scrollFullPageUp: ["Scroll a full page up"]
- reload: ["Reload the page", { noRepeat: true }]
+ reload: ["Reload the page", { background: true }]
toggleViewSource: ["View page source", { noRepeat: true }]
copyCurrentUrl: ["Copy the current URL to the clipboard", { noRepeat: true }]
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 70d97ca0..78bfce4c 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -235,6 +235,15 @@ BackgroundCommands =
tabIds = BgUtils.tabRecency.getTabsByRecency().filter (tabId) -> tabId != tab.id
if 0 < tabIds.length
selectSpecificTab id: tabIds[(count-1) % tabIds.length]
+ reload: ({count, tabId, registryEntry, tab: {windowId}})->
+ bypassCache = registryEntry.options.hard ? false
+ chrome.tabs.query {windowId}, (tabs) ->
+ position = do ->
+ for tab, index in tabs
+ return index if tab.id == tabId
+ tabs = [tabs[position...]..., tabs[...position]...]
+ count = Math.min count, tabs.length
+ chrome.tabs.reload tab.id, {bypassCache} for tab in tabs[...count]
# Remove tabs before, after, or either side of the currently active tab
removeTabsRelative = (direction, {tab: activeTab}) ->