Skip to content

Commit

Permalink
Merge pull request jinzhu#111 from wrzoski/master
Browse files Browse the repository at this point in the history
<C-r> refresh page without cached content (like in vimperator)
  • Loading branch information
jinzhu committed Mar 6, 2012
2 parents af4d642 + 26132dc commit ad7213c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/background/scripts/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ var Tab = (function() {
});
}

function reloadWithoutCache(msg) {
var tab = arguments[arguments.length-1];

chrome.tabs.reload(tab.id, {bypassCache: true});
}

function openUrl(msg) {
var tab = arguments[arguments.length-1];
var urls = msg.urls || msg.url;
Expand Down Expand Up @@ -243,6 +249,7 @@ var Tab = (function() {
goto : goto,
selectPrevious : selectPrevious,
selectLastOpen : selectLastOpen,
reloadWithoutCache: reloadWithoutCache,
reloadAll : reloadAll,
openUrl : openUrl,
openFromClipboard : openFromClipboard,
Expand Down
1 change: 1 addition & 0 deletions src/frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ with (KeyEvent) {

// Tab
add("r" , Tab.reload );
add("<C-r>", Tab.reloadWithoutCache);
add("R" , Tab.reloadAll );

add("dc" , Tab.close );
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/modules/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ var Tab = (function(){
Post({action: "Tab.reloadAll"});
}

function reloadWithoutCache() {
Post({action: "Tab.reloadWithoutCache"});
}

function close(option) {
option = option || {};
option.action = 'Tab.close';
Expand Down Expand Up @@ -72,6 +76,7 @@ var Tab = (function(){
copyUrl : copyUrl ,
reload : reload ,
reloadAll : reloadAll,
reloadWithoutCache : reloadWithoutCache,

close : close ,
closeAndFoucsLast : function(){ close({focusLast: true}); },
Expand Down

0 comments on commit ad7213c

Please sign in to comment.