diff options
author | portix <none@none> | 2012-09-05 00:02:31 +0200 |
---|---|---|
committer | portix <none@none> | 2012-09-05 00:02:31 +0200 |
commit | cd819e4d2e1b38925fe09efdff002b3aecf86baa (patch) | |
tree | cbc9fe34124f1efd3b43d8dcb6ad8f382726a966 /extensions/requestpolicy | |
parent | 0cef9b2790c2a5da8902b443842f407fcc7605a6 (diff) | |
download | dwb-cd819e4d2e1b38925fe09efdff002b3aecf86baa.zip |
Update requestpolicy, use Object.getPrivate
Diffstat (limited to 'extensions/requestpolicy')
-rw-r--r-- | extensions/requestpolicy | 17 |
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; }; })(); |