Skip to content

Commit

Permalink
fix #3408
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jan 7, 2018
1 parent 71009cf commit b7155a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
14 changes: 8 additions & 6 deletions platform/chromium/vapi-background.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2014-2017 The uBlock Origin authors
Copyright (C) 2014-2018 The uBlock Origin authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -579,11 +579,9 @@ vAPI.tabs.remove = function(tabId) {

/******************************************************************************/

vAPI.tabs.reload = function(tabId /*, flags*/) {
vAPI.tabs.reload = function(tabId, bypassCache) {
tabId = toChromiumTabId(tabId);
if ( tabId === 0 ) {
return;
}
if ( tabId === 0 ) { return; }

var onReloaded = function() {
// https://code.google.com/p/chromium/issues/detail?id=410868#c8
Expand All @@ -592,7 +590,11 @@ vAPI.tabs.reload = function(tabId /*, flags*/) {
}
};

chrome.tabs.reload(tabId, onReloaded);
chrome.tabs.reload(
tabId,
{ bypassCache: bypassCache === true },
onReloaded
);
};

/******************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions src/js/messaging.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2014-2017 Raymond Hill
Copyright (C) 2014-2018 Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -157,7 +157,7 @@ var onMessage = function(request, sender, callback) {

case 'reloadTab':
if ( vAPI.isBehindTheSceneTabId(request.tabId) === false ) {
vAPI.tabs.reload(request.tabId);
vAPI.tabs.reload(request.tabId, request.bypassCache === true);
if ( request.select && vAPI.tabs.select ) {
vAPI.tabs.select(request.tabId);
}
Expand Down
7 changes: 4 additions & 3 deletions src/js/popup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2014-2017 Raymond Hill
Copyright (C) 2014-2018 Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -831,13 +831,14 @@ var setFirewallRuleHandler = function(ev) {

/******************************************************************************/

var reloadTab = function() {
var reloadTab = function(ev) {
messaging.send(
'popupPanel',
{
what: 'reloadTab',
tabId: popupData.tabId,
select: true
select: true,
bypassCache: ev.ctrlKey || ev.metaKey
}
);

Expand Down

0 comments on commit b7155a0

Please sign in to comment.