Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7356)

Unified Diff: chrome/common/extensions/api/downloads.idl

Issue 1706193002: Expose final download URL (actual url after redirects) in the extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional documentation. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/downloads.idl
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl
index 0381c887f0cdfc65ce7e821dcf600e25a71fdd8a..72294f31527dafb7204f186990f5fecbccfac8c1 100644
--- a/chrome/common/extensions/api/downloads.idl
+++ b/chrome/common/extensions/api/downloads.idl
@@ -134,9 +134,14 @@ namespace downloads {
// An identifier that is persistent across browser sessions.
long id;
- // Absolute URL.
+ // The absolute URL that this download initiated from, before any
+ // redirects.
DOMString url;
+ // The absolute URL that this download is being made from, after all
+ // redirects.
+ DOMString finalUrl;
+
// Absolute URL.
DOMString referrer;
@@ -226,9 +231,9 @@ namespace downloads {
[inline_doc] dictionary DownloadQuery {
// This array of search terms limits results to $(ref:DownloadItem) whose
- // <code>filename</code> or <code>url</code> contain all of the search terms
- // that do not begin with a dash '-' and none of the search terms that do
- // begin with a dash.
+ // <code>filename</code> or <code>url</code> or <code>finalUrl</code>
+ // contain all of the search terms that do not begin with a dash '-' and
+ // none of the search terms that do begin with a dash.
DOMString[]? query;
// Limits results to $(ref:DownloadItem) that
@@ -263,6 +268,10 @@ namespace downloads {
// <code>url</code> matches the given regular expression.
DOMString? urlRegex;
+ // Limits results to $(ref:DownloadItem) whose
+ // <code>finalUrl</code> matches the given regular expression.
+ DOMString? finalUrlRegex;
+
// The maximum number of matching $(ref:DownloadItem) returned. Defaults to
// 1000. Set to 0 in order to return all matching $(ref:DownloadItem). See
// $(ref:search) for how to page through results.
@@ -278,9 +287,14 @@ namespace downloads {
// The <code>id</code> of the $(ref:DownloadItem) to query.
long? id;
- // Absolute URL.
+ // The absolute URL that this download initiated from, before any
+ // redirects.
DOMString? url;
+ // The absolute URL that this download is being made from, after all
+ // redirects.
+ DOMString? finalUrl;
+
// Absolute local path.
DOMString? filename;
@@ -343,19 +357,22 @@ namespace downloads {
// that changed.
long id;
- // The change in <code>url</code>, if any.
+ // The <code>url</code> of download, only if previously unknown.
StringDelta? url;
+ // The <code>finalUrl</code> of download, only if previously unknown.
+ StringDelta? finalUrl;
+
// The change in <code>filename</code>, if any.
StringDelta? filename;
// The change in <code>danger</code>, if any.
StringDelta? danger;
- // The change in <code>mime</code>, if any.
+ // The <code>mime</code> of download, only if previously unknown.
StringDelta? mime;
- // The change in <code>startTime</code>, if any.
+ // The <code>startTime</code> of download, only if previously unknown.
StringDelta? startTime;
// The change in <code>endTime</code>, if any.
@@ -523,7 +540,15 @@ namespace downloads {
// When any of a $(ref:DownloadItem)'s properties except
// <code>bytesReceived</code> and <code>estimatedEndTime</code> changes,
// this event fires with the <code>downloadId</code> and an object
- // containing the properties that changed.
+ // containing the properties that changed. This event can contain all
+ // previously unreported download item data, it will be fired in two cases:
+ // for downloads that already existed before event listener was added or
+ // for dangerous download that was accepted and is not temporary anymore.
+ // Those are the only cases where fields <code>url</code>,
+ // <code>finalUrl</code>, <code>mime</code> and <code>startTime</code> can
+ // appear in download delta, those properties cannot change after download
+ // item creation. Download delta fields in such cases will contain only
+ // current value.
asanka 2016/07/07 19:28:31 Let's not document this behavior; it's a bug and s
mharanczyk 2016/07/08 10:10:54 Reverted download delta documentation back to orig
static void onChanged(DownloadDelta downloadDelta);
// During the filename determination process, extensions will be given the

Powered by Google App Engine
This is Rietveld 408576698