summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <none@none>2012-09-05 00:02:31 +0200
committerportix <none@none>2012-09-05 00:02:31 +0200
commitcd819e4d2e1b38925fe09efdff002b3aecf86baa (patch)
treecbc9fe34124f1efd3b43d8dcb6ad8f382726a966
parent0cef9b2790c2a5da8902b443842f407fcc7605a6 (diff)
downloaddwb-cd819e4d2e1b38925fe09efdff002b3aecf86baa.zip
Update requestpolicy, use Object.getPrivate
-rw-r--r--extensions/requestpolicy17
1 files changed, 7 insertions, 10 deletions
diff --git a/extensions/requestpolicy b/extensions/requestpolicy
index e7ed941b..5ec6d6d4 100644
--- a/extensions/requestpolicy
+++ b/extensions/requestpolicy
@@ -120,18 +120,15 @@ var sigs = {
var persistentList = null;
var tmpList = {};
-var getPrivate = (function() {
- var priv = "_requestPolicy" + parseInt(Math.random() * 9999999999, 10);
+var getPrivate = (function () {
+ var identifier = {};
return function (wv) {
- var o = wv[priv];
- if (o === undefined) {
- o = { domains : [], blocked : 0 };
- Object.defineProperty(wv, priv, {
- value : o,
- writable : true
- });
+ var p = wv.getPrivate("foo", identifier);
+ if (p === null) {
+ p = { domains : [], blocked : 0 };
+ wv.setPrivate("foo", p, identifier);
}
- return o;
+ return p;
};
})();