mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
CefFrame::GetURL in the renderer process should return the provisional URL for popups during loading (issue #2448)
This commit is contained in:
@@ -34,10 +34,10 @@
|
||||
|
||||
using blink::WebString;
|
||||
|
||||
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame)
|
||||
: browser_(browser),
|
||||
frame_(frame),
|
||||
frame_id_(render_frame_util::GetIdentifier(frame)) {}
|
||||
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser,
|
||||
blink::WebLocalFrame* frame,
|
||||
int64_t frame_id)
|
||||
: browser_(browser), frame_(frame), frame_id_(frame_id) {}
|
||||
|
||||
CefFrameImpl::~CefFrameImpl() {}
|
||||
|
||||
@@ -216,6 +216,13 @@ CefString CefFrameImpl::GetURL() {
|
||||
|
||||
if (frame_) {
|
||||
GURL gurl = frame_->GetDocument().Url();
|
||||
if (gurl.is_empty()) {
|
||||
// For popups the main document URL will be empty during loading. Return
|
||||
// the provisional document URL instead.
|
||||
blink::WebDocumentLoader* loader = frame_->GetProvisionalDocumentLoader();
|
||||
if (loader)
|
||||
gurl = loader->GetRequest().Url();
|
||||
}
|
||||
url = gurl.spec();
|
||||
}
|
||||
return url;
|
||||
|
Reference in New Issue
Block a user