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

Delta Between Two Patch Sets: lib/prefs.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Left Patch Set: Rebased. Created March 7, 2017, 10:44 a.m.
Right Patch Set: Use .includes again Created March 31, 2017, 8:37 a.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 | « lib/popupBlocker.js ('k') | lib/requestBlocker.js » ('j') | 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 <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-2017 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 *
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // in the console. 284 // in the console.
285 chrome.runtime.lastError; 285 chrome.runtime.lastError;
286 286
287 for (let key in items) 287 for (let key in items)
288 defaults[key] = items[key]; 288 defaults[key] = items[key];
289 289
290 resolve(); 290 resolve();
291 }); 291 });
292 } 292 }
293 else 293 else
294 {
294 resolve(); 295 resolve();
296 }
295 }); 297 });
296 298
297 function onLoaded() 299 function onLoaded()
298 { 300 {
299 ext.storage.onChanged.addListener(changes => 301 ext.storage.onChanged.addListener(changes =>
300 { 302 {
301 for (let key in changes) 303 for (let key in changes)
302 { 304 {
303 let pref = keyToPref(key); 305 let pref = keyToPref(key);
304 if (pref && pref in defaults) 306 if (pref && pref in defaults)
305 { 307 {
306 let change = changes[key]; 308 let change = changes[key];
307 if ("newValue" in change && change.newValue != defaults[pref]) 309 if ("newValue" in change && change.newValue != defaults[pref])
308 overrides[pref] = change.newValue; 310 overrides[pref] = change.newValue;
309 else 311 else
310 delete overrides[pref]; 312 delete overrides[pref];
311 313
312 eventEmitter.emit(pref); 314 eventEmitter.emit(pref);
313 } 315 }
314 } 316 }
315 }); 317 });
316 } 318 }
317 319
318 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); 320 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded);
319 } 321 }
320 322
321 init(); 323 init();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld