Remap toolbar button in custom.js

What I’m actually trying to do:

I have an installer (for a program) that runs a notebook to demonstrate how the program works. It needs to be seamless and foolproof. Telling the user to either hit Control-C (and then kill the browser tab) or go to File->Shut Down has a very low probability of success (IMO). Also, it’s yucky. So I’d like to attach some JS to the hook for closing the browser tab that calls shutdown on the notebook.

Then the instructions to the user are “Close the notebook browser tab to continue.” But I can’t get the notebook to install/run my JS.