Voila: Pre-execute code before notebook rendering

Hello, I had some voila custom implementation questions.

  1. I am transitioning from appmode to voila and I need notebooks depending on jupyter_notebook_url to contain the fully qualified url to the notebook including query parameters. I see that query parameters is supported as demoed in query-strings.ipynb but I specifically need the jupyter_notebook_url set. Do I modify the VoilaHandler class to inject code for setting jupyter_notebook_url?

  2. My JupyterLab implementation has a labextension doing authentication into an external system by making an API call. I do this by creating a MyZMQChannelsHandler(ZMQChannelsHandler) class that overrides the open() method, sends a shell channel msg with my API call into the session, then calls the super().open() method. How can I achieve the same in voila? I tried importing my class in voila/app.py and replacing (url_path_join(self.server_url, r’/api/kernels/%s/channels’ % _kernel_id_regex), ZMQChannelsHandler), to use MyZMQChannelsHandler but it did not work nor are there any errors. Any ideas on including a custom ZMQChannelsHandler handler? I also need this to work in preview mode and saw that server_extension.py does not have add a handler for kernel channel messaging. Id like to add my custom one there as well.