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

Delta Between Two Patch Sets: messageResponder.js

Issue 4731979438227456: Issue 1663 - Emulate background page and implement proper message responder (Closed)
Left Patch Set: Using PageMap for listeners Created Dec. 19, 2014, 3:41 p.m.
Right Patch Set: Using Services.vc Created Dec. 19, 2014, 5:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « firstRun.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 switch (message.type) 79 switch (message.type)
80 { 80 {
81 case "app.get": 81 case "app.get":
82 if (message.what == "issues") 82 if (message.what == "issues")
83 { 83 {
84 var info = require("info"); 84 var info = require("info");
85 callback({ 85 callback({
86 seenDataCorruption: "seenDataCorruption" in global ? global.seenData Corruption : false, 86 seenDataCorruption: "seenDataCorruption" in global ? global.seenData Corruption : false,
87 filterlistsReinitialized: "filterlistsReinitialized" in global ? glo bal.filterlistsReinitialized : false, 87 filterlistsReinitialized: "filterlistsReinitialized" in global ? glo bal.filterlistsReinitialized : false,
88 legacySafariVersion: (info.platform == "safari" && ( 88 legacySafariVersion: (info.platform == "safari" && (
89 parseInt(info.platformVersion, 10) < 6 || // beforeload breaks w ebsites in Safari 5 89 Services.vc.compare(info.platformVersion, "6.0") < 0 || // bef oreload breaks websites in Safari 5
Thomas Greiner 2014/12/19 16:58:23 Since this is only running in the context of the b
Wladimir Palant 2014/12/19 17:45:38 Done.
90 info.platformVersion == "6.1" || // extensions are brok en in 6.1 and 7.0 90 Services.vc.compare(info.platformVersion, "6.1") == 0 || // ext ensions are broken in 6.1 and 7.0
91 info.platformVersion == "7.0")) 91 Services.vc.compare(info.platformVersion, "7.0") == 0))
92 }); 92 });
93 } 93 }
94 else if (message.what == "doclink") 94 else if (message.what == "doclink")
95 callback(Utils.getDocLink(message.link)); 95 callback(Utils.getDocLink(message.link));
96 else 96 else
97 callback(null); 97 callback(null);
98 break; 98 break;
99 case "app.open": 99 case "app.open":
100 if (message.what == "options") 100 if (message.what == "options")
101 { 101 {
102 if (typeof UI != "undefined") 102 if (typeof UI != "undefined")
103 UI.openFiltersDialog(); 103 UI.openFiltersDialog();
104 else 104 else
105 global.openOptions(); 105 global.openOptions();
Sebastian Noack 2014/12/22 09:56:17 window.openOptions() is deprecated. Please use ext
Wladimir Palant 2015/01/15 13:03:22 I filed #1813 and #1814 on that.
106 } 106 }
107 break; 107 break;
108 case "subscriptions.get": 108 case "subscriptions.get":
109 var subscriptions = FilterStorage.subscriptions.filter(function(s) 109 var subscriptions = FilterStorage.subscriptions.filter(function(s)
110 { 110 {
111 if (message.ignoreDisabled && s.disabled) 111 if (message.ignoreDisabled && s.disabled)
112 return false; 112 return false;
113 if (s instanceof DownloadableSubscription && message.downloadable) 113 if (s instanceof DownloadableSubscription && message.downloadable)
114 return true; 114 return true;
115 if (s instanceof SpecialSubscription && message.special) 115 if (s instanceof SpecialSubscription && message.special)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 if (message.filter) 153 if (message.filter)
154 filters.subscription = message.filter; 154 filters.subscription = message.filter;
155 else 155 else
156 delete filters.subscription; 156 delete filters.subscription;
157 break; 157 break;
158 } 158 }
159 }); 159 });
160 })(this); 160 })(this);
LEFTRIGHT
« firstRun.js ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld