OLD | NEW |
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 Loading... |
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 mistakenly reports requests of type 'object' | 322 // Chrome 38 and 39 mistakenly reports requests of type 'object' |
323 // (e.g. requests initiated by Flash) with the type 'other'. | 323 // (e.g. requests initiated by Flash) 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\/38\b/.test(navigator.userAgent
)) | 325 if (requestType == "other" && / Chrome\/3[8-9]\b/.test(navigator.userA
gent)) |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 }; | 370 }; |
371 | 371 |
372 return ext.onMessage._dispatch(message, sender, sendResponse); | 372 return ext.onMessage._dispatch(message, sender, sendResponse); |
373 }); | 373 }); |
374 | 374 |
375 | 375 |
376 /* Storage */ | 376 /* Storage */ |
377 | 377 |
378 ext.storage = localStorage; | 378 ext.storage = localStorage; |
379 })(); | 379 })(); |
OLD | NEW |