At least one issue solved.
Yes, this should be able to work for subpages and other multi page apps.
Callbacks should be outside of functions, functions will cause it to try to reapply the callbacks. And also not apply at start up.
Do you have an MRE?