Skip to content

Commit

Permalink
[DevTools] Fallback to MainFrameNavigated event url in Security panel
Browse files Browse the repository at this point in the history
If a HTTPS connection is blocked for security reasons, an interstitial
is presented and the Network Manager does not raise a ResponseReceived
event. Previously, the lack of a matching ResponseReceived event would
prevent the MainFrameNavigated event from correctly setting the "Main
Origin" for the sidebar.

With this CL, if the main navigation request was not previously
captured by the ResponseReceived event, we will instead compute the
Main Origin by looking at the URL in the MainFrameNavigated event
itself.

BUG=669309
TEST=blink_layouttests. Alternatively, open Security Panel. Navigate through https://expired.badssl.com/
interstitial. Verify Main Origin appears in sidebar.

Review-Url: https://codereview.chromium.org/2756983002
Cr-Commit-Position: refs/heads/master@{#458639}
  • Loading branch information
ericlaw1979 authored and Commit bot committed Mar 22, 2017
1 parent 2b57967 commit bfea3be
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions front_end/security/SecurityPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,14 @@ Security.SecurityPanel = class extends UI.PanelWithSidebar {
// explanations to reflect the new counts.
this._mainView.refreshExplanations();

if (request) {
var origin = Common.ParsedURL.extractOrigin(request.url());
this._sidebarTree.setMainOrigin(origin);
// If we could not find a matching request (as in the case of clicking
// through an interstitial, see crbug.com/669309), set the origin based upon
// the url data from the MainFrameNavigated event itself.
let origin = Common.ParsedURL.extractOrigin(request ? request.url() : frame.url);
this._sidebarTree.setMainOrigin(origin);

if (request)
this._processRequest(request);
}
}

_onInterstitialShown() {
Expand Down

0 comments on commit bfea3be

Please sign in to comment.