Permalink
Browse files

new command ReloadAllTabs

  • Loading branch information...
1 parent 1180edc commit a7f25eb4a168debececa2c9da1804cfc4106cde3 @k2nr k2nr committed Dec 2, 2011
Showing with 35 additions and 0 deletions.
  1. +7 −0 background.js
  2. +4 −0 coffee/background.coffee
  3. +1 −0 coffee/command.coffee
  4. +6 −0 coffee/tab.coffee
  5. +1 −0 command.js
  6. +16 −0 tab.js
View
Oops, something went wrong.
View
@@ -133,6 +133,10 @@ g.bg =
)
false
+ reqReloadAllTabs : (req) ->
+ g.tabs?.reloadAllTabs?()
+ false
+
reqMoveToNextTab : (req) ->
if req.args?[0]?
if req.args[0] <= 0 then return
View
@@ -58,6 +58,7 @@ class g.CommandExecuter
Alias : sendToBackground
OpenNewWindow : sendToBackground
ReloadTab : triggerInsideContent
+ ReloadAllTabs : sendToBackground
ScrollUp : triggerInsideContent
ScrollDown : triggerInsideContent
ScrollLeft : triggerInsideContent
View
@@ -1,5 +1,6 @@
this.vichrome ?= {}
g = this.vichrome
+g.tabs = {}
class g.TabSelectionHistory
init : ->
@@ -186,3 +187,8 @@ class g.TabHistory
opt = { windowId : item.tab.windowId, url : item.tab.url }
chrome.tabs.create( opt, (tab) => )
+g.tabs.reloadAllTabs = ->
+ chrome.tabs.getAllInWindow( null, (tabs) ->
+ chrome.tabs.update( tab.id, url: tab.url ) for tab in tabs
+ )
+
View
Oops, something went wrong.
View
16 tab.js
Oops, something went wrong.

0 comments on commit a7f25eb

Please sign in to comment.