Commit a90a5a2a authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[DevTools] clean console on navigation as early as possible

BUG=none
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2563883005
Cr-Commit-Position: refs/heads/master@{#437684}
parent daaaf866
......@@ -204,8 +204,6 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
this.dispatchEventToListeners(SDK.ResourceTreeModel.Events.MainFrameNavigated, frame);
if (Common.moduleSetting('preserveConsoleLog').get())
Common.console.log(Common.UIString('Navigated to %s', frame.url));
else
this.target().consoleModel.clear();
}
if (addedOrigin)
this._securityOriginManager.addSecurityOrigin(addedOrigin);
......@@ -238,6 +236,21 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
frame._remove();
}
/**
* @param {!Protocol.Page.FrameId} frameId
*/
_frameStartedLoading(frameId) {
// Do nothing unless cached resource tree is processed - it will overwrite everything.
if (!this._cachedResourcesProcessed)
return;
var frame = this._frames.get(frameId);
if (frame && !frame.isMainFrame())
return;
if (!Common.moduleSetting('preserveConsoleLog').get())
this.target().consoleModel.clear();
}
/**
* @param {!Common.Event} event
*/
......@@ -788,6 +801,7 @@ SDK.PageDispatcher = class {
* @param {!Protocol.Page.FrameId} frameId
*/
frameStartedLoading(frameId) {
this._resourceTreeModel._frameStartedLoading(frameId);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment