Skip to content

Commit

Permalink
Merge pull request #5271 from Rob--W/opera-fixes
Browse files Browse the repository at this point in the history
Opera fixes
  • Loading branch information
yurydelendik committed Sep 9, 2014
2 parents 15059ea + 7938081 commit 9261cd9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions extensions/chromium/pdfHandler-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
6 changes: 5 additions & 1 deletion web/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,15 @@ var Preferences = {
// // These preferences can be overridden by the user.
// chrome.storage.managed.get(DEFAULT_PREFERENCES, getPreferences);
// } else {
// // Managed storage not supported, e.g. in Opera.
// // Managed storage not supported, e.g. in old Chromium versions.
// getPreferences(DEFAULT_PREFERENCES);
// }
//
// function getPreferences(defaultPrefs) {
// if (chrome.runtime.lastError) {
// // Managed storage not supported, e.g. in Opera.
// defaultPrefs = DEFAULT_PREFERENCES;
// }
// chrome.storage.local.get(defaultPrefs, function(readPrefs) {
// resolve(readPrefs);
// });
Expand Down

0 comments on commit 9261cd9

Please sign in to comment.