| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 } | 428 } |
| 429 }, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]); | 429 }, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]); |
| 430 | 430 |
| 431 | 431 |
| 432 /* Message passing */ | 432 /* Message passing */ |
| 433 | 433 |
| 434 chrome.runtime.onMessage.addListener(function(message, rawSender, sendResponse ) | 434 chrome.runtime.onMessage.addListener(function(message, rawSender, sendResponse ) |
| 435 { | 435 { |
| 436 var sender = {}; | 436 var sender = {}; |
| 437 | 437 |
| 438 // Add "page" and "frame" if messsage were sent by content script. | 438 // Add "page" and "frame" if the message was sent by a content script. |
|
kzar
2015/03/02 19:00:32
Nit: "...if the message was sent by a..."
Sebastian Noack
2015/03/02 19:42:08
Done.
| |
| 439 // If sent by popup or the background page itself, there is no "tab". | 439 // If sent by popup or the background page itself, there is no "tab". |
| 440 if ("tab" in rawSender) | 440 if ("tab" in rawSender) |
| 441 { | 441 { |
| 442 sender.page = new Page(rawSender.tab); | 442 sender.page = new Page(rawSender.tab); |
| 443 sender.frame = { | 443 sender.frame = { |
| 444 url: new URL(rawSender.url), | 444 url: new URL(rawSender.url), |
| 445 get parent() | 445 get parent() |
| 446 { | 446 { |
| 447 var frames = framesOfTabs[rawSender.tab.id]; | 447 var frames = framesOfTabs[rawSender.tab.id]; |
| 448 | 448 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 callback(new Page(tab)); | 519 callback(new Page(tab)); |
| 520 } | 520 } |
| 521 else | 521 else |
| 522 { | 522 { |
| 523 ext.pages.open(optionsUrl, callback); | 523 ext.pages.open(optionsUrl, callback); |
| 524 } | 524 } |
| 525 }); | 525 }); |
| 526 }); | 526 }); |
| 527 }; | 527 }; |
| 528 })(); | 528 })(); |
| LEFT | RIGHT |