Koha plugins using hooks opac_head/js or intranet_head/js should be created with CGI context. So that the behaviour may depend on vars sent to page.
While I can see the short-term gain, this sounds like a long-term headache. Wherever possible, we should be trying to avoid all things CGI these days. Not doing so is just adding technical debt...
(In reply to David Cook from comment #1) > While I can see the short-term gain, this sounds like a long-term headache. > > Wherever possible, we should be trying to avoid all things CGI these days. > Not doing so is just adding technical debt... Ahhh I see your point, specially for OPAC we encourage REST API. Since plugins can create API routes, lets say its the way to provide datas. I close.