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

Side by Side Diff: ext/background.js

Issue 29760680: Issue 4580 - Removed ext.storage (Closed)
Patch Set: Created April 24, 2018, 5:18 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 | lib/io.js » ('j') | lib/io.js » ('J')
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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 574 }
575 }; 575 };
576 } 576 }
577 577
578 return ext.onMessage._dispatch( 578 return ext.onMessage._dispatch(
579 message, sender, sendResponse 579 message, sender, sendResponse
580 ).includes(true); 580 ).includes(true);
581 }); 581 });
582 582
583 583
584 /* Storage */
585
586 ext.storage = {
587 get(keys, callback)
588 {
589 browser.storage.local.get(keys, callback);
590 },
591 set(key, value, callback)
592 {
593 let items = {};
594 items[key] = value;
595 browser.storage.local.set(items, callback);
596 },
597 remove(key, callback)
598 {
599 browser.storage.local.remove(key, callback);
600 },
601 onChanged: browser.storage.onChanged
602 };
603
604 /* Windows */ 584 /* Windows */
605 ext.windows = { 585 ext.windows = {
606 create(createData, callback) 586 create(createData, callback)
607 { 587 {
608 browser.windows.create(createData, createdWindow => 588 browser.windows.create(createData, createdWindow =>
609 { 589 {
610 afterTabLoaded(callback)(createdWindow.tabs[0]); 590 afterTabLoaded(callback)(createdWindow.tabs[0]);
611 }); 591 });
612 } 592 }
613 }; 593 };
614 } 594 }
OLDNEW
« no previous file with comments | « no previous file | lib/io.js » ('j') | lib/io.js » ('J')

Powered by Google App Engine
This is Rietveld