New issue
Advanced search Search tips

Issue 735425 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

<webview> Tag canGoBack() function doesn't work properly

Reported by ruckaja...@gmail.com, Jun 21 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.104 Safari/537.36

Steps to reproduce the problem:
1. Have a new webview on some valid page.
2. Navigate webview to some invalid page (e.g. webview.src="https://www.blablablabla.bla")
3. Wait for webview to finish (e.g. to "loadstop" event)
4. Call "canGoBack()" function on webview. It will return false. But "back()" function will navigate back anyway.

What is the expected behavior?
"canGoBack()" function on webview returns proper value. If true navigation back is indeed possible and vice versa.

What went wrong?
"canGoBack()" returns false when navigated to invalid page (if there is just one previous page).

Did this work before? Yes 55

Does this work in other browsers? Yes

Chrome version: 59.0.3071.104  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

In attached example (chrome unpacked extension) there is webview on valid page (google.com). With "Go!" button you will navigate to invalid page ("https://www.blablablabla.bla"). You can see "webview-canGoBack" button is disabled (because webview.canGoBack() returns false). If you call "back()" function anyway via "webview-back" button it will navigate back. if you will navigate to valid page "webview-canGoBack" button will be enabled.

The reason is that in "DidFinishNavigation" function (extensions/browser/guest_view/web_view/web_view_guest.cc see link to related commit below) doesn't dispatch "webview::kEventLoadCommit" event in case of error page. One of the easier fixes in my eyes, hopefully will be fixed soon in chromium upstream.

Issue was introduced here:
related review:
https://codereview.chromium.org/2411293002

related commit:
https://chromium.googlesource.com/chromium/src/+/6adb8c23bd7b3fe24398c5500a2f89c758e36a4d
 
example.zip
1.6 KB Download
Labels: Needs-Triage-M59
Components: Platform>Apps>BrowserTag
Labels: -Hotlist-Interop
Cc: jam@chromium.org
cc'ing jam@ because the suspected commit is his

Comment 4 by jam@chromium.org, Nov 20 2017

Owner: jam@chromium.org
Status: Started (was: Unconfirmed)

Comment 5 by jam@chromium.org, Nov 20 2017

Thanks for redirecting it.
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d8ce902f8b56be412af44d1d6e2993b682004e7c

commit d8ce902f8b56be412af44d1d6e2993b682004e7c
Author: John Abd-El-Malek <jam@chromium.org>
Date: Tue Nov 21 05:06:42 2017

Fix regression from r425073 with loadcommit events not firing for failed navigations.

In the old navigation callbacks, DidFailProvisionalLoad would fire for the failed load, and DidCommitProvisionalLoadForFrame would fire for the error page. So the webview would get both loadabort and loadcommit. Fix this with the new navigation APIs and add a regression test.

BUG:  735425 
Bug:  735425 
Change-Id: I1f4885fdba05cce1934d37c588aea286033b83fe
Reviewed-on: https://chromium-review.googlesource.com/779061
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518128}
[modify] https://crrev.com/d8ce902f8b56be412af44d1d6e2993b682004e7c/extensions/browser/guest_view/web_view/web_view_apitest.cc
[modify] https://crrev.com/d8ce902f8b56be412af44d1d6e2993b682004e7c/extensions/browser/guest_view/web_view/web_view_guest.cc
[modify] https://crrev.com/d8ce902f8b56be412af44d1d6e2993b682004e7c/extensions/test/data/web_view/apitest/main.js

Comment 7 by jam@chromium.org, Nov 21 2017

Status: Fixed (was: Started)

Sign in to add a comment