OLD | NEW |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 } | 1072 } |
1073 | 1073 |
1074 for (var i = 0; i < shareResources.length; i++) | 1074 for (var i = 0; i < shareResources.length; i++) |
1075 checkShareResource(shareResources[i], onResult); | 1075 checkShareResource(shareResources[i], onResult); |
1076 } | 1076 } |
1077 | 1077 |
1078 ext.onMessage.addListener(function(message) | 1078 ext.onMessage.addListener(function(message) |
1079 { | 1079 { |
1080 switch (message.type) | 1080 switch (message.type) |
1081 { | 1081 { |
1082 case "app.listen": | 1082 case "app.event": |
1083 if (message.action == "addSubscription") | 1083 if (message.action == "addSubscription") |
1084 { | 1084 { |
1085 var subscription = message.args[0]; | 1085 var subscription = message.args[0]; |
1086 var dialog = E("dialog-content-predefined"); | 1086 var dialog = E("dialog-content-predefined"); |
1087 dialog.querySelector("h3").textContent = subscription.title || ""; | 1087 dialog.querySelector("h3").textContent = subscription.title || ""; |
1088 dialog.querySelector(".url").textContent = subscription.url; | 1088 dialog.querySelector(".url").textContent = subscription.url; |
1089 openDialog("predefined"); | 1089 openDialog("predefined"); |
1090 } | 1090 } |
1091 break; | 1091 break; |
1092 case "filters.listen": | 1092 case "filters.event": |
1093 onFilterMessage(message.action, message.args[0]); | 1093 onFilterMessage(message.action, message.args[0]); |
1094 break; | 1094 break; |
1095 case "prefs.listen": | 1095 case "prefs.event": |
1096 onPrefMessage(message.action, message.args[0]); | 1096 onPrefMessage(message.action, message.args[0]); |
1097 break; | 1097 break; |
1098 case "subscriptions.listen": | 1098 case "subscriptions.event": |
1099 onSubscriptionMessage(message.action, message.args[0]); | 1099 onSubscriptionMessage(message.action, message.args[0]); |
1100 break; | 1100 break; |
1101 } | 1101 } |
1102 }); | 1102 }); |
1103 | 1103 |
1104 ext.backgroundPage.sendMessage( | 1104 ext.backgroundPage.sendMessage( |
1105 { | 1105 { |
1106 type: "app.listen", | 1106 type: "app.listen", |
1107 filter: ["addSubscription"] | 1107 filter: ["addSubscription"] |
1108 }); | 1108 }); |
(...skipping 11 matching lines...) Expand all Loading... |
1120 }); | 1120 }); |
1121 ext.backgroundPage.sendMessage( | 1121 ext.backgroundPage.sendMessage( |
1122 { | 1122 { |
1123 type: "subscriptions.listen", | 1123 type: "subscriptions.listen", |
1124 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1124 filter: ["added", "disabled", "homepage", "lastDownload", "removed", |
1125 "title"] | 1125 "title"] |
1126 }); | 1126 }); |
1127 | 1127 |
1128 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1128 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1129 })(); | 1129 })(); |
OLD | NEW |