diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index fcc0ea2e8855..befe17db78b9 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -99,11 +99,14 @@ void WebContents::Stop() { } void WebContents::Reload() { - web_contents()->GetController().Reload(false); + // Navigating to a URL would always restart the renderer process, we want this + // because normal reloading will break our node integration. + // This is done by AtomBrowserClient::ShouldSwapProcessesForNavigation. + LoadURL(GetURL()); } void WebContents::ReloadIgnoringCache() { - web_contents()->GetController().ReloadIgnoringCache(false); + Reload(); } bool WebContents::CanGoBack() const { diff --git a/atom/browser/api/lib/browser-window.coffee b/atom/browser/api/lib/browser-window.coffee index 7413ff8b8415..421d8842d6a7 100644 --- a/atom/browser/api/lib/browser-window.coffee +++ b/atom/browser/api/lib/browser-window.coffee @@ -81,7 +81,7 @@ BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments BrowserWindow::send = -> @webContents.send.apply @webContents, arguments # Be compatible with old API. -BrowserWindow::restart = -> @webContents.restart() +BrowserWindow::restart = -> @webContents.reload() BrowserWindow::getUrl = -> @webContents.getUrl() BrowserWindow::reload = -> @webContents.reload() BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache() diff --git a/atom/browser/api/lib/web-contents.coffee b/atom/browser/api/lib/web-contents.coffee index 822f34623485..5e7212334764 100644 --- a/atom/browser/api/lib/web-contents.coffee +++ b/atom/browser/api/lib/web-contents.coffee @@ -11,10 +11,6 @@ module.exports.wrap = (webContents) -> webContents.send = (args...) -> @_send 'ATOM_INTERNAL_MESSAGE', [args...] - # WebContents::restart() - # Restart the renderer process. - webContents.restart = -> @loadUrl @getUrl() - # The processId and routingId and identify a webContents. webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}" webContents.equal = (other) -> @getId() is other.getId() diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index bd7d95ab47c6..2c51b03b9831 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -83,7 +83,8 @@ bool AtomBrowserClient::ShouldSwapProcessesForNavigation( if (site_instance->HasProcess()) dying_render_process_ = site_instance->GetProcess(); - // Restart renderer process for all navigations. + // Restart renderer process for all navigations, this relies on a patch to + // Chromium: http://git.io/_PaNyg. return true; }