diff options
author | portix <portix@gmx.net> | 2014-03-24 10:12:17 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-24 10:12:17 +0100 |
commit | 545397b3061e0899bab50e52e9710f53f2eeaf52 (patch) | |
tree | d7db908706538f1034ecf16b5e58e9b24abdab6f | |
parent | 937da7ef873ecebb944fdde6fed64f34c753fbbc (diff) | |
download | dwb-545397b3061e0899bab50e52e9710f53f2eeaf52.zip |
Use script.own in requestpolicy
-rw-r--r-- | extensions/requestpolicy | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/extensions/requestpolicy b/extensions/requestpolicy index eada339a..9823eb40 100644 --- a/extensions/requestpolicy +++ b/extensions/requestpolicy @@ -433,23 +433,22 @@ var requestpolicy = { } } persistentList = persistentList || {}; - Signal.connect("resource", resourceCB); - Signal.connect("navigation", navigationCB); + + script.own( + Signal.connect("resource", resourceCB), + Signal.connect("navigation", navigationCB), + bind(config.shortcut, showMenu, "requestpolicy"), + bind(config.unblockCurrent, unblockCurrent, "requestpolicyUnblockCurrent"), + bind(config.unblockAll, unblockAll, "requestpolicyUnblockAll") + ); + if (config.notify) - Signal.connect("loadFinished", loadFinishedCB); - bind(config.shortcut, showMenu, "requestpolicy"); - bind(config.unblockCurrent, unblockCurrent, "requestpolicyUnblockCurrent"); - bind(config.unblockAll, unblockAll, "requestpolicyUnblockAll"); + script.own(Signal.connect("loadFinished", loadFinishedCB)); return true; }, end : function () { - Signal.disconnect(resourceCB); - Signal.disconnect(navigationCB); - Signal.disconnect(loadFinishedCB); - unbind("requestpolicy"); - unbind("requestpolicyUnblockCurrent"); - unbind("requestpolicyUnblockAll"); + script.removeHandles(); } }; return requestpolicy; |