New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680863 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Chrome app webview sending incorrect 'loadstart' events

Reported by r...@rdharris.org, Jan 13 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
Platform: 9000.50.0 (Official Build) beta-channel sumo

Steps to reproduce the problem:
1. Create a chrome app with a webview where the source is a single page app (e.g. http://form.tab.com.au)
2. Add a load start event listener for the webview (e.g. webview.addEventListener('loadstart', function() {console.log('load started'))
3. Navigate to another URL which is handled by the app, i.e. doesn't require a new page to load 

What is the expected behavior?
The loadstart event shouldn't be fired on the url change within the single page app, it should only fire when an new page is loaded.

What went wrong?
The loadstart event is fired

Did this work before? Yes 55.0.2883.105

Does this work in other browsers? N/A

Chrome version: 56.0.294.53  Channel: beta
OS Version: 56.0.294.53
Flash Version: 

This is also happening for the 'loadstop' event.

This only happens on the beta release 56.0.2924.58, it isn't happening on stable 55.0.2883.105.  It is causing an issue for my app as it detects if webview content fails to load and displays a splash screen and reloads the page if that happens.  One of the failure scenarios the app checks is if there is a 'loadstart' event for top level followed by a 'loadstop' event and no content is loaded in between the events.  In 56.0.2924.58 every time a single page app changes url that scenario is triggered and the whole page is reloaded.
 
Cc: xiy...@chromium.org

Comment 2 by xiy...@chromium.org, Jan 13 2017

Cc: fsam...@chromium.org
Owner: mknowles@chromium.org
#0, could you clarify what "Navigate to another URL which is handled by the app" means? I assume it means that the base URL does not change, i.e. host and URL path is not changed, just the param or '#' part changes.

If so, it sounds like there is a behavior change from M55 to M56. 'loadstart' was not fired in M55 with such URL change but M56 the event is fired.

mknowles@, could you help to triage or clarify what is the expected behavior of 'loadstart'/'loadstop'?

Comment 3 by xiy...@chromium.org, Jan 13 2017

Cc: wjmaclean@chromium.org

Comment 4 by r...@rdharris.org, Jan 14 2017

#2, I meant when the path changes using the html5 history API which is commonly used by single page app routing libraries like angular and react.  https://staticapps.org/articles/routing-urls-in-static-apps/

So the path in the URL changes but the browsers does not request a to load a new page, the loaded page handle the change in URL to show new content. In M55 this change of URL didn't fire the 'loadstart' event but in M56 it does.
Cc: sduraisamy@chromium.org
Cc: -wjmaclean@chromium.org mknowles@chromium.org
Owner: wjmaclean@chromium.org
James - could you take a look to see what notifications may have changed for this type of navigation?
Cc: cederberg@chromium.org
Labels: -Pri-2 M-56 ReleaseBlock-Stable Pri-1
Our team is severely affected by this.

A team member has narrowed down the change in behavior to
56.0.2889.0 working correctly
56.0.2890.0 broken

Is there agreement on this being a bug rather than a change of behavior keeping within spec? Seems to me that a loadstart event should not be fired unless the browser actually requests a load.
Correct, it certainly looks like a bug. We're bisecting this now to see if we can find the root cause.
Cc: wjmaclean@chromium.org
Owner: jam@chromium.org
jam@ - Would you please take a look to see how this can be fixed?
Status: Assigned (was: Unconfirmed)

Comment 12 by jam@chromium.org, Jan 20 2017

Status: Started (was: Assigned)
If someone has a reduced repro they can attach that would be helpful.

Comment 13 by mcnee@chromium.org, Jan 20 2017

Here's what I used.

Open the app and look at the console. If it just shows the loadstart for http://form.tab.com.au/ then it's good; if it shows an extra loadstart for http://form.tab.com.au/racing/home then it's bad.
680863-test.crx
1.4 KB Download
cederberg@ - Would your team like to test locally just to verify your issue is fixed by this CL?

We should request merge once it's been through a canary release, perhaps the start of next week?

Comment 16 by aelder@google.com, Jan 20 2017

Thanks! I'll build and verify that this fixes our issue.
Sure, I will build and verify as soon as I see a release containing the CL.

Thank you so much for acting on this so quickly. Much appreciated!
aelder@ is more competent than me when it comes to this, so if he verifies then I am confident in the result.
Cc: bustamante@chromium.org
Labels: OS-Linux OS-Mac OS-Windows
Spoke with wjmaclean@, this is not just Chrome OS but desktop as well.  +bustamante for desktop.

Comment 20 by aelder@google.com, Jan 20 2017

Confirmed. Synced past that commit and verified that fixes our issue. Thanks again!

Comment 21 by jam@chromium.org, Jan 20 2017

Thanks for verifying. I have a reminder to request merge on Tuesday morning.

Comment 22 by jam@chromium.org, Jan 23 2017

Labels: Merge-Request-56 Merge-Request-57

Comment 23 by jam@chromium.org, Jan 23 2017

(I won't do the merge till Tuesday, requesting now to be ready then)
Project Member

Comment 24 by sheriffbot@chromium.org, Jan 23 2017

Labels: -Merge-Request-57 Hotlist-Merge-Approved Merge-Approved-57
Your change meets the bar and is auto-approved for M57. Please go ahead and merge the CL to branch 2987 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), ketakid@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 25 by sheriffbot@chromium.org, Jan 23 2017

Labels: -Merge-Request-56 Hotlist-Merge-Approved Merge-Approved-56
Your change meets the bar and is auto-approved for M56. Please go ahead and merge the CL to branch 2924 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), gkihumba@(cros), bustamante@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 26 by sheriffbot@chromium.org, Jan 23 2017

Labels: -Merge-Request-57 Merge-Approved-57
Your change meets the bar and is auto-approved for M57. Please go ahead and merge the CL to branch 2987 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), ketakid@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 27 by bugdroid1@chromium.org, Jan 23 2017

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9742bd9ee6833f78f23f7c3fb841b05e0c691612

commit 9742bd9ee6833f78f23f7c3fb841b05e0c691612
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Jan 23 18:34:04 2017

Fix regression of webview loadstart events firing for same page navigations.

This regressed in r425073 since DidStartProvisionalLoadForFrame didn't fire for same page navigations while DidStartNavigation does.

BUG= 680863 

Review-Url: https://codereview.chromium.org/2647933002
Cr-Commit-Position: refs/heads/master@{#445150}
(cherry picked from commit 840012cf9996d156f6e3286a37ca0c9d5d502edc)

Review-Url: https://codereview.chromium.org/2646423003 .
Cr-Commit-Position: refs/branch-heads/2924@{#843}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/9742bd9ee6833f78f23f7c3fb841b05e0c691612/extensions/browser/guest_view/web_view/web_view_apitest.cc
[modify] https://crrev.com/9742bd9ee6833f78f23f7c3fb841b05e0c691612/extensions/browser/guest_view/web_view/web_view_guest.cc
[add] https://crrev.com/9742bd9ee6833f78f23f7c3fb841b05e0c691612/extensions/test/data/web_view/apitest/guest_same_page_navigation.html
[modify] https://crrev.com/9742bd9ee6833f78f23f7c3fb841b05e0c691612/extensions/test/data/web_view/apitest/main.js

Project Member

Comment 28 by bugdroid1@chromium.org, Jan 23 2017

Labels: -merge-approved-57 merge-merged-2987
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/852d488f12bf3778e57c4d7a50316c6006c4d108

commit 852d488f12bf3778e57c4d7a50316c6006c4d108
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Jan 23 18:43:28 2017

Fix regression of webview loadstart events firing for same page navigations.

This regressed in r425073 since DidStartProvisionalLoadForFrame didn't fire for same page navigations while DidStartNavigation does.

BUG= 680863 

Review-Url: https://codereview.chromium.org/2647933002
Cr-Commit-Position: refs/heads/master@{#445150}
(cherry picked from commit 840012cf9996d156f6e3286a37ca0c9d5d502edc)

Review-Url: https://codereview.chromium.org/2649213002 .
Cr-Commit-Position: refs/branch-heads/2987@{#29}
Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943}

[modify] https://crrev.com/852d488f12bf3778e57c4d7a50316c6006c4d108/extensions/browser/guest_view/web_view/web_view_apitest.cc
[modify] https://crrev.com/852d488f12bf3778e57c4d7a50316c6006c4d108/extensions/browser/guest_view/web_view/web_view_guest.cc
[add] https://crrev.com/852d488f12bf3778e57c4d7a50316c6006c4d108/extensions/test/data/web_view/apitest/guest_same_page_navigation.html
[modify] https://crrev.com/852d488f12bf3778e57c4d7a50316c6006c4d108/extensions/test/data/web_view/apitest/main.js

Comment 29 by jam@chromium.org, Jan 23 2017

Status: Fixed (was: Started)
Project Member

Comment 30 by bugdroid1@chromium.org, Jan 23 2017

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

commit 200122aeb0d45ce0b2943b82d7be22d4d16e1482
Author: John Abd-El-Malek <jam@chromium.org>
Date: Mon Jan 23 23:04:49 2017

Fix compile after recent merge

The test harness changed on the branch since the fix, so the straight merge broke the build.

BUG= 680863 

Review-Url: https://codereview.chromium.org/2655523002 .
Cr-Commit-Position: refs/branch-heads/2924@{#849}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/200122aeb0d45ce0b2943b82d7be22d4d16e1482/extensions/browser/guest_view/web_view/web_view_apitest.cc

Cc: tkonch...@chromium.org
Labels: TE-Verified-M56 TE-Verified-56.0.2924.76
Tested the fix as per the steps in comment#13 on win10, mac 10.12.2, Linux 14.04 chrome version 56.0.2924.76 - Observed that console displays loadstart for http://form.tab.com.au/ as shown in the screenshot

Fix works as expected
Screen Shot 2017-01-25 at 1.41.00 PM.png
381 KB View Download

Sign in to add a comment