Is custom.js not supported anymore?

Is there a way to run custom javascript in a notebook? I tried using ~/.jupyter/custom/custom.js but it doesn’t seem to work.

Try passing --c.LabApp.custom_css=True to jupyterlab command. Relevant thread

1 Like

Isn’t that for jupyterlab?

JupyterHub starts your singleuser server, typically Jupyter-Server with JupyterLab, so configuration of the front-end is mostly independent of JupyterHub.

In general it’d be helpful if you provide more information in your posts, have a read through

2 Likes

Right. I’m deploying JupyterHub and I want to run custom javascript in the singleuser server. My goal is to customize the Kernel died unexpectedly message that pops up when the culling takes place.

This message pops up when frontend loses the websocket connection over the kernel running on the server. This can happen for many reasons not just for culling. For examples, in k8s environment, an OOM-killer can kill kernel on the server when it goes over the memory limit and that event shows up on the frontend like Kernel died unexpectedly. So, it is going to be very hard to capture the specific cull event from the frontend.

I actually don’t really care about capturing the culling event. If I could change the message to:

Kernel died unexpectedly. The server could have been killed as a result of your inactivity.

then that would serve my purpose.