New issue
Advanced search Search tips

Issue 695303 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Web Request API: Cancel is allowed on all stages which support blocking.

Project Member Reported by karandeepb@chromium.org, Feb 23 2017

Issue description

Chrome Version: 56.0.2924.87

The Web Request API documentation states that the cancel parameter of BlockingResponse can only be used in the onBeforeRequest stage of a web request. See https://developer.chrome.com/extensions/webRequest#type-BlockingResponse. 

However in practice, cancelling the request is supported on all stages which support blocking, namely-
  -onBeforeRequest
  -onBeforeSendHeaders
  -onHeadersReceived
  -onAuthRequired


 
Cc: rdevlin....@chromium.org battre@chromium.org
The code seems pretty clear in its intent, so not sure why the discrepancy. We have two options- Change the documentation or change the code to be in accordance with the documentation, however this may break some extensions.
Seems the documentation is inconsistent. Some places do specify that cancellation is allowed for other stages. Will update the docs.
updating docs to reflect code sgtm.
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 29 2017

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

commit ba9fcdb8648ddcf577f121ba908df84888bd8056
Author: Karan Bhatia <karandeepb@chromium.org>
Date: Tue Aug 29 03:56:49 2017

WebRequest API Docs: Clarify the stages in which request can be cancelled.

The current documentation for the Web Request API is a bit unclear on the
network request stages in which a network request can be cancelled. Update the
docs to reflect that a network request can be cancelled in the onBeforeRequest,
onBeforeSendHeaders, onHeadersReceived and onAuthRequired stages.

BUG= 695303 

Change-Id: I6464a21aa5049d17d70027c7a5c8748e7ba1e81b
Reviewed-on: https://chromium-review.googlesource.com/639234
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498017}
[modify] https://crrev.com/ba9fcdb8648ddcf577f121ba908df84888bd8056/chrome/common/extensions/docs/templates/intros/webRequest.html
[modify] https://crrev.com/ba9fcdb8648ddcf577f121ba908df84888bd8056/extensions/common/api/web_request.json

Labels: -OS-Linux
Status: Fixed (was: Assigned)

Sign in to add a comment