+ var _itemStorage = new Object();
+
+ var _SetItem = function(itemKey, itemValue) {
+ var result = extension.internal.sendSyncMessage({
+ cmd: 'SetPreferencesItem',
+ preferencesItemKey: String(itemKey),
+ preferencesItemValue: String(itemValue) });
+
+ if (result) {
+ if (_itemStorage[String(itemKey)] == undefined)
+ _keyList.push(String(itemKey));
+ _itemStorage[String(itemKey)] = String(itemValue);
+ return itemValue;
+ } else {
+ throw new common.CustomDOMException(
+ common.CustomDOMException.NO_MODIFICATION_ALLOWED_ERR,
+ 'The object can not be modified.');
+ }
+ }
+
+ var _GetSetter = function(itemKey) {
+ var _itemKey = itemKey;
+ return function(itemValue) {
+ return _SetItem(_itemKey, itemValue);
+ }
+ }
+
+ var _GetGetter = function(itemKey) {
+ var _itemKey = itemKey;
+ return function() {
+ return _itemStorage[String(_itemKey)];
+ }
+ }