New issue
Advanced search Search tips

Issue 907167 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

History manipulation intervention

Project Member Reported by shivanisha@google.com, Nov 20

Issue description

Spec: https://github.com/WICG/interventions/issues/21

At times we come across a web page which makes it impossible or difficult for the user to go back to the page it came from using the browser back button. This is done by manipulating the browser history and could result in an abusive/annoying user experience.  

This intervention is going to skip entries in the back/forward list on back button invocation that were added without the user’s intention. 
Specifically the entries that will be skipped are those pages that add themselves (and possibly more entries) to the browser’s back/forward list but actually redirect the user to another URL automatically (with no user gesture ever).  The browser already replaces entries of pages that do this behavior before load and this intervention strengthens that further by intervening on pages after load as well.
Note that the intervention only impacts the back/forward button and not the history.back/forward API.
 
Cc: csharrison@chromium.org
Components: UI>Browser>Navigation
Labels: Hotlist-Abusive
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 12

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

commit 41f04c521bae20b4ad80b14265f44aa940495e2f
Author: shivanisha <shivanisha@chromium.org>
Date: Wed Dec 12 15:52:05 2018

Mark entries to be skipped on back for history manipulation intervention.

Entries that are added to the back/forward list without the user's intention
are marked to be skipped on subsequent back button invocations.
This CL only adds the bit and subsequent CLs will add metrics and the intervention
logic based on this bit.

Test: content_browsertests --gtest_filter=*SkipOnBack*
Bug: 907167
Change-Id: I169031de2c977b53605960b8baf0cd1f6ac4ef47
Reviewed-on: https://chromium-review.googlesource.com/c/1344199
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615904}
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigation_controller_impl.h
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigation_controller_impl_browsertest.cc
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigation_entry_impl.cc
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigation_entry_impl.h
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/public/test/content_browser_test_utils.cc
[modify] https://crrev.com/41f04c521bae20b4ad80b14265f44aa940495e2f/content/public/test/content_browser_test_utils.h

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 13

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

commit 5520187c4b5c12a3f2dc4170c71335ad36edb993
Author: shivanisha <shivanisha@chromium.org>
Date: Thu Dec 13 04:29:06 2018

Adds metrics for history manipulation intervention

This CL uses the skippable flag on a NavigationEntry to log various
metrics.
There is no functional change.

Test: content_browsertests --gtest_filter=*SkipOnBack*
Bug: 907167
Change-Id: I9dd0e993a5d2afda49888bea3439b06b5f03b12c
Reviewed-on: https://chromium-review.googlesource.com/c/1347491
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616213}
[modify] https://crrev.com/5520187c4b5c12a3f2dc4170c71335ad36edb993/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/5520187c4b5c12a3f2dc4170c71335ad36edb993/content/browser/frame_host/navigation_controller_impl_browsertest.cc
[modify] https://crrev.com/5520187c4b5c12a3f2dc4170c71335ad36edb993/content/public/common/content_constants.cc
[modify] https://crrev.com/5520187c4b5c12a3f2dc4170c71335ad36edb993/content/public/common/content_constants.h
[modify] https://crrev.com/5520187c4b5c12a3f2dc4170c71335ad36edb993/tools/metrics/histograms/histograms.xml

Description: Show this description
Project Member

Comment 5 by bugdroid1@chromium.org, Jan 8

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

commit 2d5b4b6bac52ca6a5bddae54123610d2967b2060
Author: Shivani Sharma <shivanisha@chromium.org>
Date: Tue Jan 08 16:07:16 2019

Implements history manipulation intervention

Implements history manipulation intervention behind a flag and based on the
should_skip_on_back_forward_ui_ field added earlier.

Note that this Cl has the following todo not implemented here:
- Implement the logic when all entries are skippable.
Currently we default to go to current entry -/+ 1 on back and forward
respectively even if those are skippable.
This is currently being discussed and will be implemented in a follow up CL

Test: content_browsertests --gtest_filter=*SkipOnBack*
Bug: 907167
Change-Id: I3bdb181613527a4c6e4715553eb6c7ed38540e62
Reviewed-on: https://chromium-review.googlesource.com/c/1377524
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620743}
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/chrome/browser/about_flags.cc
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/chrome/browser/flag-metadata.json
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/chrome/browser/flag_descriptions.cc
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/chrome/browser/flag_descriptions.h
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/content/browser/frame_host/navigation_controller_impl_browsertest.cc
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/content/public/common/content_features.cc
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/content/public/common/content_features.h
[modify] https://crrev.com/2d5b4b6bac52ca6a5bddae54123610d2967b2060/tools/metrics/histograms/enums.xml

Project Member

Comment 6 by bugdroid1@chromium.org, Jan 10

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

commit f790179e78ec6ec8095fa88cb924e9cf3fb499c3
Author: Shivani Sharma <shivanisha@chromium.org>
Date: Thu Jan 10 20:26:02 2019

History intervention: Add tests for history API

This CL adds tests to verify that history.back and forward APIs are not
impacted by this intervention.

Test: content_browsertests --gtest_filter=*DoNotSkipForHistory*
Bug: 907167
Change-Id: I0cfe1ebed5b5ad456432b99ea7dafe2fe1c78e71
Reviewed-on: https://chromium-review.googlesource.com/c/1393019
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621727}
[modify] https://crrev.com/f790179e78ec6ec8095fa88cb924e9cf3fb499c3/content/browser/frame_host/navigation_controller_impl_browsertest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Today (21 hours ago)

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

commit 298d1285b58145a779ab64ac03af3381cd62cd43
Author: Shivani Sharma <shivanisha@chromium.org>
Date: Tue Jan 22 20:04:03 2019

History intervention: all entries are skippable

This Cl makes NavigationController::CanGoBack() return false if all
entries are marked to be skipped on back/forward UI. On desktop this
leads to the back button being disabled. On Android, it will close
the current tab and a previous tab could be shown as
it usually happens on Android when you press back from the first entry
of a tab.

browser_tests --gtest_filter=*SkippableBackButton*
content_browsertests --gtest_filter=
*NoUserActivationSetSkippableMultipleGoBack

Test: 
Bug: 907167
Change-Id: Icda3cbe0e87f7ae8033ed2d9650c0372316ab12d
Reviewed-on: https://chromium-review.googlesource.com/c/1388811
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Shivani Sharma <shivanisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624885}
[modify] https://crrev.com/298d1285b58145a779ab64ac03af3381cd62cd43/chrome/browser/chrome_navigation_browsertest.cc
[modify] https://crrev.com/298d1285b58145a779ab64ac03af3381cd62cd43/content/browser/frame_host/navigation_controller_impl.cc
[modify] https://crrev.com/298d1285b58145a779ab64ac03af3381cd62cd43/content/browser/frame_host/navigation_controller_impl_browsertest.cc
[modify] https://crrev.com/298d1285b58145a779ab64ac03af3381cd62cd43/tools/metrics/histograms/histograms.xml

Comment 8 by fatjo...@gmail.com, Today (9 hours ago)

Our web application implements its own history API on top of the native API. Our custom history API uses its own history list and prevents the native history list from growing.

Our application does not prevent the user to go back to a previous page. However, from the point of the native history, it can look like too many back-presses are needed to go to the previous page.

A back-press in our app will always cause either a change in the app's UI (e.g. closing a dialog) or go back to the previous page. It will never cause a redirect. As such, it does not seem to fall under the set of pages that are specified in this Issue's description. However the commits in this Issue look like they could very well break our app's custom history API.

What is the target version of this change? I would like to test our web application's custom history API.

Comment 9 by shivanisha@chromium.org, Today (54 minutes ago)

 fatjoe79@gmail.com: Sure, you can test your application's API in latest Google Chrome Canary build.

Comment 10 by shivanisha@chromium.org, Today (52 minutes ago)

fatjoe79@gmail.com:
Also, please enable the feature's flag as below:
- go to chrome://flags
- Set enable-history-manipulation-intervention flag to Enabled.

Sign in to add a comment