mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Add BrowserWindow.restart() to restart renderer process.
This commit is contained in:
@@ -14,6 +14,9 @@ BrowserWindow::toggleDevTools = ->
|
||||
@openDevTools()
|
||||
v8Util.setHiddenValue this, 'devtoolsOpened', true
|
||||
|
||||
BrowserWindow::restart = ->
|
||||
@loadUrl(@getUrl())
|
||||
|
||||
BrowserWindow.getFocusedWindow = ->
|
||||
windows = objectsRegistry.getAllWindows()
|
||||
return window for window in windows when window.isFocused()
|
||||
|
||||
@@ -38,6 +38,14 @@ void AtomBrowserClient::OverrideWebkitPrefs(
|
||||
prefs->enable_scroll_animator = false;
|
||||
}
|
||||
|
||||
bool AtomBrowserClient::ShouldSwapProcessesForNavigation(
|
||||
content::SiteInstance* site_instance,
|
||||
const GURL& current_url,
|
||||
const GURL& new_url) {
|
||||
// Restart renderer process if navigating to the same url.
|
||||
return current_url == new_url;
|
||||
}
|
||||
|
||||
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
||||
const content::MainFunctionParams&) {
|
||||
return new AtomBrowserMainParts;
|
||||
|
||||
@@ -18,6 +18,10 @@ class AtomBrowserClient : public brightray::BrowserClient {
|
||||
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
||||
const GURL& url,
|
||||
webkit_glue::WebPreferences* prefs) OVERRIDE;
|
||||
virtual bool ShouldSwapProcessesForNavigation(
|
||||
content::SiteInstance* site_instance,
|
||||
const GURL& current_url,
|
||||
const GURL& new_url) OVERRIDE;
|
||||
|
||||
private:
|
||||
virtual brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
||||
|
||||
Reference in New Issue
Block a user