Commit 12ed4123 authored by Patrick Hulce's avatar Patrick Hulce Committed by Commit Bot

DevTools: return the correct defaultExecutionContext

* Uses the sorted list by frame to determine the defaultExecutionContext.
* Fixes issue where Audits panel would audit the wrong URL.

BUG=742044

Change-Id: I56a1ebd0a0d1f2f9decd603f78c5b73921ea635e
Reviewed-on: https://chromium-review.googlesource.com/570921Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Patrick Hulce <phulce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486888}
parent fe6f35b2
......@@ -248,6 +248,8 @@ Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
if (!executionContext)
return Promise.resolve();
// Evaluate location.href for a more specific URL than inspectedURL provides so that SPA hash navigation routes
// will be respected and audited.
return new Promise(resolve => {
executionContext.evaluate('window.location.href', 'audits', false, false, true, false, false, (object, err) => {
if (!err && object) {
......
......@@ -113,7 +113,7 @@ SDK.RuntimeModel = class extends SDK.SDKModel {
* @return {?SDK.ExecutionContext}
*/
defaultExecutionContext() {
for (var context of this._executionContextById.values()) {
for (var context of this.executionContexts()) {
if (context.isDefault)
return context;
}
......
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