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

Side by Side Diff: lib/prefs.js

Issue 5999015493632000: Issue 2541 - Suppress error on Opera when calling chrome.storage.managed.get() (Closed)
Patch Set: Made comment more verbose Created May 19, 2015, 4:07 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 localLoaded = true; 276 localLoaded = true;
277 checkLoaded(); 277 checkLoaded();
278 }); 278 });
279 } 279 }
280 }); 280 });
281 281
282 if (require("info").platform == "chromium" && "managed" in chrome.storage) 282 if (require("info").platform == "chromium" && "managed" in chrome.storage)
283 { 283 {
284 chrome.storage.managed.get(null, function(items) 284 chrome.storage.managed.get(null, function(items)
285 { 285 {
286 // Opera doesn't support chrome.storage.managed, but instead simply
287 // removing the API, Opera sets chrome.runtime.lastError when using it.
288 // So we have to retrieve that error, to prevent it from showing up
289 // in the console.
290 chrome.runtime.lastError;
291
286 for (let key in items) 292 for (let key in items)
287 defaults[key] = items[key]; 293 defaults[key] = items[key];
288 294
289 managedLoaded = true; 295 managedLoaded = true;
290 checkLoaded(); 296 checkLoaded();
291 }); 297 });
292 } 298 }
293 else 299 else
294 { 300 {
295 managedLoaded = true; 301 managedLoaded = true;
296 checkLoaded(); 302 checkLoaded();
297 } 303 }
298 } 304 }
299 305
300 init(); 306 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