mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: reloadIgnoringCache() should ignore the cache (#21283)
This commit is contained in:
@@ -152,7 +152,8 @@ const NavigationController = (function () {
|
||||
NavigationController.prototype.reloadIgnoringCache = function () {
|
||||
this.pendingIndex = this.currentIndex
|
||||
return this.webContents._loadURL(this.getURL(), {
|
||||
extraHeaders: 'pragma: no-cache\n'
|
||||
extraHeaders: 'pragma: no-cache\n',
|
||||
reloadIgnoringCache: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1386,6 +1386,12 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
|
||||
params.load_type = content::NavigationController::LOAD_TYPE_DATA;
|
||||
}
|
||||
|
||||
bool reload_ignoring_cache = false;
|
||||
if (options.Get("reloadIgnoringCache", &reload_ignoring_cache) &&
|
||||
reload_ignoring_cache) {
|
||||
params.reload_type = content::ReloadType::BYPASSING_CACHE;
|
||||
}
|
||||
|
||||
// Calling LoadURLWithParams() can trigger JS which destroys |this|.
|
||||
auto weak_this = GetWeakPtr();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user