1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-31 03:32:38 +01:00

move reload() and reload_all() global functions to vimperator.tabs

This commit is contained in:
Doug Kearns
2007-07-02 12:40:56 +00:00
parent 5064fc7f44
commit 3ca1ee8651
3 changed files with 39 additions and 40 deletions

View File

@@ -1021,6 +1021,41 @@ function Tabs() //{{{
this.alternate = this.getTab();
this.reload = function(tab, bypass_cache)
{
if (bypass_cache)
{
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
const flags = nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
getBrowser().getBrowserForTab(tab).reloadWithFlags(flags);
}
else
{
getBrowser().reloadTab(tab);
}
}
this.reloadAll = function(bypass_cache)
{
if (bypass_cache)
{
for (var i = 0; i < getBrowser().mTabs.length; i++)
{
try
{
this.reload(getBrowser().mTabs[i], bypass_cache)
}
catch (e) {
// FIXME: can we do anything useful here without stopping the
// other tabs from reloading?
}
}
}
else
{
getBrowser().reloadAllTabs();
}
}
//}}}
} //}}}