diff options
author | portix <none@none> | 2013-03-04 12:37:52 +0100 |
---|---|---|
committer | portix <none@none> | 2013-03-04 12:37:52 +0100 |
commit | ad996d9cf4e143b17feeee9e4d43542169a7091b (patch) | |
tree | 6941305d4da9463a4e39ddddb586f86645d776c6 /extensions/requestpolicy | |
parent | 69cc2ce8bff1f3d8bdac9977230d18e6c31bfc57 (diff) | |
download | dwb-ad996d9cf4e143b17feeee9e4d43542169a7091b.zip |
Use _initNewContext to initialize scripts, change setPrivate/getPrivate api
Diffstat (limited to 'extensions/requestpolicy')
-rw-r--r-- | extensions/requestpolicy | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/extensions/requestpolicy b/extensions/requestpolicy index 84f7daae..62e1d81e 100644 --- a/extensions/requestpolicy +++ b/extensions/requestpolicy @@ -120,19 +120,16 @@ var sigs = { var persistentList = null; var tmpList = {}; -var getPrivate = (function () +var getPrivate = function (wv) { - var identifier = {}; - return function (wv) { - var p = wv.getPrivate("foo", identifier); - if (!p) - { - p = { domains : [], blocked : 0 }; - wv.setPrivate("foo", p, identifier); - } - return p; - }; -})(); + var p = script.getPrivate(wv, "foo"); + if (!p) + { + p = { domains : [], blocked : 0 }; + script.setPrivate(wv, "foo", p); + } + return p; +}; function listAdd(o, key, value, doWrite) { |