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

Side by Side Diff: lib/prefs.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Created June 7, 2017, 12:41 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
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-2017 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
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 { 267 {
268 for (let key in items) 268 for (let key in items)
269 overrides[keyToPref(key)] = items[key]; 269 overrides[keyToPref(key)] = items[key];
270 270
271 resolve(); 271 resolve();
272 }); 272 });
273 }); 273 });
274 274
275 let managedLoaded = new Promise(resolve => 275 let managedLoaded = new Promise(resolve =>
276 { 276 {
277 if (require("info").platform == "chromium" && "managed" in chrome.storage) 277 if (typeof chrome == "object" && "managed" in chrome.storage)
Sebastian Noack 2017/06/07 14:42:14 Won't typeof chrome == "object" always evaluate to
kzar 2017/06/08 10:50:27 I thought so too, but maybe we're missing somethin
Sebastian Noack 2017/06/08 10:59:19 Most likely, when this change was intially authore
kzar 2017/06/08 11:37:43 Yea, that's true. Just thought I'd mention it sinc
Oleksandr 2017/06/14 03:41:01 Yes. This was for issue #3705. It doesn't look lik
Sebastian Noack 2017/06/14 05:13:38 Yeah, please remove the platform check, so that sh
278 { 278 {
279 chrome.storage.managed.get(null, items => 279 chrome.storage.managed.get(null, items =>
280 { 280 {
281 // Opera doesn't support chrome.storage.managed, but instead simply 281 // Opera doesn't support chrome.storage.managed, but instead simply
282 // removing the API, Opera sets chrome.runtime.lastError when using it. 282 // removing the API, Opera sets chrome.runtime.lastError when using it.
283 // So we have to retrieve that error, to prevent it from showing up 283 // So we have to retrieve that error, to prevent it from showing up
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)
(...skipping 26 matching lines...) Expand all
314 eventEmitter.emit(pref); 314 eventEmitter.emit(pref);
315 } 315 }
316 } 316 }
317 }); 317 });
318 } 318 }
319 319
320 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded); 320 Prefs.untilLoaded = Promise.all([localLoaded, managedLoaded]).then(onLoaded);
321 } 321 }
322 322
323 init(); 323 init();
OLDNEW

Powered by Google App Engine
This is Rietveld