From 26132dc7f84355c5cb5d43a668e5f4f73eee4f46 Mon Sep 17 00:00:00 2001 From: Lukasz Wrzosek Date: Tue, 6 Mar 2012 10:11:44 +0100 Subject: [PATCH] Added binding. Added binding to reload page without cached content like in vimperator. --- src/background/scripts/modules/tab.js | 7 +++++++ src/frontend/main.js | 1 + src/frontend/modules/tab.js | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/background/scripts/modules/tab.js b/src/background/scripts/modules/tab.js index e834212f..f4faeda8 100644 --- a/src/background/scripts/modules/tab.js +++ b/src/background/scripts/modules/tab.js @@ -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; @@ -243,6 +249,7 @@ var Tab = (function() { goto : goto, selectPrevious : selectPrevious, selectLastOpen : selectLastOpen, + reloadWithoutCache: reloadWithoutCache, reloadAll : reloadAll, openUrl : openUrl, openFromClipboard : openFromClipboard, diff --git a/src/frontend/main.js b/src/frontend/main.js index 0afc2812..17ce309a 100644 --- a/src/frontend/main.js +++ b/src/frontend/main.js @@ -128,6 +128,7 @@ with (KeyEvent) { // Tab add("r" , Tab.reload ); + add("", Tab.reloadWithoutCache); add("R" , Tab.reloadAll ); add("dc" , Tab.close ); diff --git a/src/frontend/modules/tab.js b/src/frontend/modules/tab.js index 9dd9d9ed..f1682d1e 100644 --- a/src/frontend/modules/tab.js +++ b/src/frontend/modules/tab.js @@ -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'; @@ -72,6 +76,7 @@ var Tab = (function(){ copyUrl : copyUrl , reload : reload , reloadAll : reloadAll, + reloadWithoutCache : reloadWithoutCache, close : close , closeAndFoucsLast : function(){ close({focusLast: true}); },