2014-09-11 16:52:34 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
|
|
|
|
µBlock - a Chromium browser extension to block requests.
|
|
|
|
Copyright (C) 2014 Raymond Hill
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see {http://www.gnu.org/licenses/}.
|
|
|
|
|
|
|
|
Home: https://github.com/gorhill/uBlock
|
|
|
|
*/
|
|
|
|
|
2014-10-19 16:44:09 +02:00
|
|
|
/* global µBlock */
|
2014-10-19 13:11:27 +02:00
|
|
|
'use strict';
|
2014-09-11 16:52:34 +02:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
µBlock.XAL = (function(){
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
var exports = {};
|
2014-10-07 16:46:10 +02:00
|
|
|
var noopFunc = function(){};
|
2014-09-11 16:52:34 +02:00
|
|
|
|
2014-09-28 20:38:17 +02:00
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2014-10-11 22:44:56 +02:00
|
|
|
exports.keyvalSetOne = function(key, val, callback) {
|
2014-10-06 20:02:44 +02:00
|
|
|
var bin = {};
|
|
|
|
bin[key] = val;
|
2014-10-17 21:44:19 +02:00
|
|
|
vAPI.storage.set(bin, callback || noopFunc);
|
2014-10-06 20:02:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2014-10-11 22:44:56 +02:00
|
|
|
exports.keyvalSetMany = function(dict, callback) {
|
2014-10-17 21:44:19 +02:00
|
|
|
vAPI.storage.set(dict, callback || noopFunc);
|
2014-10-07 14:59:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2014-12-28 16:07:43 +01:00
|
|
|
exports.keyvalRemoveOne = function(key, callback) {
|
|
|
|
vAPI.storage.remove(key, callback || noopFunc);
|
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2014-10-07 14:59:35 +02:00
|
|
|
exports.keyvalRemoveAll = function(callback) {
|
2014-10-17 21:44:19 +02:00
|
|
|
vAPI.storage.clear(callback || noopFunc);
|
2014-10-07 14:59:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
2014-09-11 16:52:34 +02:00
|
|
|
return exports;
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
})();
|