From 7938081e813ccbfb1be789bfb567a71dd51f9a36 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Sat, 6 Sep 2014 00:41:08 +0200 Subject: [PATCH] streamsPrivate API change. Since 25 February 2014 (crbug.com/345882) --- extensions/chromium/pdfHandler-v2.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/chromium/pdfHandler-v2.js b/extensions/chromium/pdfHandler-v2.js index 9bfbc099a..76456979a 100644 --- a/extensions/chromium/pdfHandler-v2.js +++ b/extensions/chromium/pdfHandler-v2.js @@ -180,6 +180,16 @@ limitations under the License. * (added in Chrome 29, http://crbug.com/230346) */ function handleStream(mimeType, pdfUrl, streamUrl, tabId, expectedSize) { + if (typeof mimeType === 'object') { + // API change: argument list -> object, see crbug.com/345882 + // documentation: chrome/common/extensions/api/streams_private.idl + var streamInfo = mimeType; + mimeType = streamInfo.mimeType; + pdfUrl = streamInfo.originalUrl; + streamUrl = streamInfo.streamUrl; + tabId = streamInfo.tabId; + expectedSize = streamInfo.expectedContentSize; + } console.log('Intercepted ' + mimeType + ' in tab ' + tabId + ' with URL ' + pdfUrl + '\nAvailable as: ' + streamUrl); streamSupportsTabId = typeof tabId === 'number';