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

Side by Side Diff: lib/prefs.js

Issue 29721777: Issue 6474 - Enabled pre-configured preferences through managed storage on Firefox (Closed)
Patch Set: Created March 13, 2018, 7:44 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 { 333 {
334 for (let key in items) 334 for (let key in items)
335 overrides[keyToPref(key)] = items[key]; 335 overrides[keyToPref(key)] = items[key];
336 336
337 resolve(); 337 resolve();
338 }); 338 });
339 }); 339 });
340 340
341 let managedLoaded = new Promise(resolve => 341 let managedLoaded = new Promise(resolve =>
342 { 342 {
343 if (require("info").platform == "chromium" && "managed" in browser.storage) 343 if ("managed" in browser.storage)
344 { 344 {
345 browser.storage.managed.get(null, items => 345 browser.storage.managed.get(null, items =>
346 { 346 {
347 // Opera doesn't support browser.storage.managed, but instead simply 347 // Opera doesn't support browser.storage.managed, but instead simply
348 // removing the API, Opera sets browser.runtime.lastError when using it. 348 // removing the API, Opera sets browser.runtime.lastError when using it.
349 // So we have to retrieve that error, to prevent it from showing up 349 // So we have to retrieve that error, to prevent it from showing up
350 // in the console. 350 // in the console.
351 browser.runtime.lastError; 351 browser.runtime.lastError;
352 352
353 for (let key in items) 353 for (let key in items)
(...skipping 26 matching lines...) Expand all
380 eventEmitter.emit(pref); 380 eventEmitter.emit(pref);
381 } 381 }
382 } 382 }
383 }); 383 });
384 } 384 }
385 385
386 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); 386 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded);
387 } 387 }
388 388
389 init(); 389 init();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld