Merge pull request #5119 from electron/hijack-reload
Handle the Page.reload command coming from devtools
This commit is contained in:
commit
313883b1fc
4 changed files with 14 additions and 1 deletions
|
@ -635,6 +635,10 @@ void WebContents::DidUpdateFaviconURL(
|
||||||
Emit("page-favicon-updated", unique_urls);
|
Emit("page-favicon-updated", unique_urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebContents::DevToolsReloadPage() {
|
||||||
|
Emit("devtools-reload-page");
|
||||||
|
}
|
||||||
|
|
||||||
void WebContents::DevToolsFocused() {
|
void WebContents::DevToolsFocused() {
|
||||||
Emit("devtools-focused");
|
Emit("devtools-focused");
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
||||||
void DidChangeThemeColor(SkColor theme_color) override;
|
void DidChangeThemeColor(SkColor theme_color) override;
|
||||||
|
|
||||||
|
// brightray::InspectableWebContentsDelegate:
|
||||||
|
void DevToolsReloadPage() override;
|
||||||
|
|
||||||
// brightray::InspectableWebContentsViewDelegate:
|
// brightray::InspectableWebContentsViewDelegate:
|
||||||
void DevToolsFocused() override;
|
void DevToolsFocused() override;
|
||||||
void DevToolsOpened() override;
|
void DevToolsOpened() override;
|
||||||
|
|
|
@ -155,6 +155,11 @@ let wrapWebContents = function (webContents) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// The devtools requests the webContents to reload.
|
||||||
|
webContents.on('devtools-reload-page', function () {
|
||||||
|
webContents.reload()
|
||||||
|
})
|
||||||
|
|
||||||
// Delays the page-title-updated event to next tick.
|
// Delays the page-title-updated event to next tick.
|
||||||
webContents.on('-page-title-updated', function (...args) {
|
webContents.on('-page-title-updated', function (...args) {
|
||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
|
@ -168,6 +173,7 @@ let wrapWebContents = function (webContents) {
|
||||||
deprecate.event(webContents, 'page-title-set', 'page-title-updated', function (...args) {
|
deprecate.event(webContents, 'page-title-set', 'page-title-updated', function (...args) {
|
||||||
return this.emit.apply(this, ['page-title-set'].concat(args))
|
return this.emit.apply(this, ['page-title-set'].concat(args))
|
||||||
})
|
})
|
||||||
|
|
||||||
webContents.printToPDF = function (options, callback) {
|
webContents.printToPDF = function (options, callback) {
|
||||||
var printingSetting
|
var printingSetting
|
||||||
printingSetting = {
|
printingSetting = {
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit f7fa7efc28798bddd302ef5849a74c8bef164347
|
Subproject commit cedb11316627ac0e01a5dcd38e75bd1c5a6afa17
|
Loading…
Reference in a new issue