Closed ljleb closed 1 year ago
oh yeah I just found a solution. On extension reload we test if the function is hijacked and if it isn't, we hijack it again. Instead of hijacking in place with annotation, we could register functions to be hijacked and then call smth like do_hijack()
at the bottom of the extension code.
better even, there's a callback setup function on_script_unloaded
from modules.script_callbacks
. using this in general bug fix pr
btw we tried hijacking the webui function that filters extensions thst is called when reloading the ui, but unfortunately the module where this function is located is reset when reloading the webui. with this approach, our hijack function only gets to be called once, whether the extension is to be disabled or not.
There could be a way to hijack this function on ui reload but to achieve this we have to go detective mode on more webui code I think.