Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/ext/background.js

Issue 6668950364487680: Issue 1593 - Extend workaround for Chrome bug breaking Flash videos to Chrome >=38 (Closed)
Patch Set: Created Nov. 24, 2014, 10:12 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 var frameId; 312 var frameId;
313 if (requestType == "sub_frame") 313 if (requestType == "sub_frame")
314 frameId = details.parentFrameId; 314 frameId = details.parentFrameId;
315 else 315 else
316 frameId = details.frameId; 316 frameId = details.frameId;
317 317
318 frame = frames[frameId] || frames[Object.keys(frames)[0]]; 318 frame = frames[frameId] || frames[Object.keys(frames)[0]];
319 319
320 if (frame) 320 if (frame)
321 { 321 {
322 // Chrome 38 and 39 mistakenly reports requests of type 'object' 322 // Since Chrome 38 requests of type 'object' (e.g. requests
323 // (e.g. requests initiated by Flash) with the type 'other'. 323 // initiated by Flash) are mistakenly reported with the type 'other'.
324 // https://code.google.com/p/chromium/issues/detail?id=410382 324 // https://code.google.com/p/chromium/issues/detail?id=410382
325 if (requestType == "other" && / Chrome\/3[8-9]\b/.test(navigator.userA gent)) 325 if (requestType == "other" && parseInt(navigator.userAgent.match(/\bCh rome\/(\d+)/)[1], 10) >= 38)
Wladimir Palant 2014/11/25 16:45:51 This will error out if navigator.userAgent.match()
Sebastian Noack 2014/11/25 17:04:04 Well, in that case parseInt() will return NaN, and
326 requestType = "object"; 326 requestType = "object";
327 327
328 if (!ext.webRequest.onBeforeRequest._dispatch(details.url, requestType , new Page({id: details.tabId}), frame)) 328 if (!ext.webRequest.onBeforeRequest._dispatch(details.url, requestType , new Page({id: details.tabId}), frame))
329 return {cancel: true}; 329 return {cancel: true};
330 } 330 }
331 } 331 }
332 332
333 if (isMainFrame || details.type == "sub_frame") 333 if (isMainFrame || details.type == "sub_frame")
334 frames[details.frameId] = {url: details.url, parent: frame}; 334 frames[details.frameId] = {url: details.url, parent: frame};
335 } 335 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 callback(new Page(tab)); 406 callback(new Page(tab));
407 } 407 }
408 else 408 else
409 { 409 {
410 ext.pages.open(optionsUrl, callback); 410 ext.pages.open(optionsUrl, callback);
411 } 411 }
412 }); 412 });
413 }); 413 });
414 }; 414 };
415 })(); 415 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld