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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 "use strict"; | 18 "use strict"; |
19 | 19 |
20 var applicatonVersion = navigator.userAgent.match(/Version\/([\d.]+)/)[1]; | 20 var majorApplicationVersion = parseInt(navigator.userAgent.match(/Version\/([\d]
+)/)[1]); |
21 var majorApplicationVersion = parseInt(applicatonVersion.split(".")[0], 10); | |
22 | 21 |
23 /** | 22 /** |
24 * Creates a wrapping function used to conveniently send a type of message. | 23 * Creates a wrapping function used to conveniently send a type of message. |
25 * | 24 * |
26 * @param {Object} baseMessage The part of the message that's always sent | 25 * @param {Object} baseMessage The part of the message that's always sent |
27 * @param {..string} paramKeys Any message keys that have dynamic values. The | 26 * @param {..string} paramKeys Any message keys that have dynamic values. The |
28 * returned function will take the corresponding | 27 * returned function will take the corresponding |
29 * values as arguments. | 28 * values as arguments. |
30 * @return The generated messaging function, optionally taking any values as | 29 * @return The generated messaging function, optionally taking any values as |
31 * specified by the paramKeys and finally an optional callback. | 30 * specified by the paramKeys and finally an optional callback. |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 onFilterMessage(message.action, message.args[0]); | 772 onFilterMessage(message.action, message.args[0]); |
774 break; | 773 break; |
775 case "prefs.respond": | 774 case "prefs.respond": |
776 onPrefMessage(message.action, message.args[0]); | 775 onPrefMessage(message.action, message.args[0]); |
777 break; | 776 break; |
778 case "subscriptions.respond": | 777 case "subscriptions.respond": |
779 onSubscriptionMessage(message.action, message.args[0]); | 778 onSubscriptionMessage(message.action, message.args[0]); |
780 break; | 779 break; |
781 } | 780 } |
782 }); | 781 }); |
LEFT | RIGHT |