Open onemen opened 10 years ago
In my implementation extension A doesn't unwrap function, if current function isn't equal to previously created wrapper (and leave wrapper, but with disabled changes). So, this creates memory leak, but not breaks user experience. https://github.com/Infocatcher/Private_Tab/blob/0.1.7.3/patcher.jsm#L114
Anyway, it's looks impossible to track, what happens with somehow changed wrapper: another extension may restore some intermediate state, if there is more than two wrappers.
I know that your code doesn't unwrap the function is it wasn't the last wrapper. what's worries me is all the other restart-less extensions, as many extensions get restart-less users can enable/disable extensions during the session.
As a workaround i can add listener to extensions disabled/uninstalled with AddonManager and after each such event disabled the previous patch and apply the patcher again on all functions
As a workaround i can add listener to extensions disabled/uninstalled with AddonManager and after each such event disabled the previous patch and apply the patcher again on all functions
Oh, may be. But this increases memory usage (because we can ignore only if our wrapper wasn't changed) and probably logically wrong to try fix another extensions.
I would like to implement in Tabmix some variation of patcher.jsm.
the thing that concern me the most is how to detect if third-party restartless extension override my code when it run its unload function, when user disable the extension during session.
can this happen ?
in this scenario my wrap function foo no longer work. my question is there a way to test if my function is still alive? remember that i can't tell if my extension was the first wrapper or the last wrapper of foo.