1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-13 15:54:54 +12:00
This commit is contained in:
gorhill 2017-11-19 18:18:02 -05:00
parent 88912170fc
commit 76639f528a
4 changed files with 8 additions and 7 deletions

View file

@ -339,14 +339,14 @@ vAPI.tabs.remove = function(tabId) {
/******************************************************************************/
vAPI.tabs.reload = function(tabId /*, flags*/) {
vAPI.tabs.reload = function(tabId, bypassCache) {
if ( typeof tabId === 'string' ) {
tabId = parseInt(tabId, 10);
}
if ( isNaN(tabId) ) {
return;
}
chrome.tabs.reload(tabId);
chrome.tabs.reload(tabId, { bypassCache: bypassCache === true });
};
/******************************************************************************/

View file

@ -54,7 +54,7 @@ function onMessage(request, sender, callback) {
switch ( request.what ) {
case 'forceReloadTab':
µm.forceReload(request.tabId);
µm.forceReload(request.tabId, request.bypassCache);
break;
case 'forceUpdateAssets':

View file

@ -1197,10 +1197,11 @@ function revertAll() {
/******************************************************************************/
function buttonReloadHandler() {
function buttonReloadHandler(ev) {
messager.send({
what: 'forceReloadTab',
tabId: matrixSnapshot.tabId
tabId: matrixSnapshot.tabId,
bypassCache: ev.shiftKey
});
}

View file

@ -570,8 +570,8 @@ vAPI.tabs.registerListeners();
/******************************************************************************/
µm.forceReload = function(tabId) {
vAPI.tabs.reload(tabId, { bypassCache: true });
µm.forceReload = function(tabId, bypassCache) {
vAPI.tabs.reload(tabId, bypassCache);
};
/******************************************************************************/