You can modify the panel / sidebar with a hidden field…
It’s kind-a-hackish, but it works…
- edit - The way I did it, was embedding a field that was not visible / doing nothing at all.
But it allowed me to inject some javascript - which added extra functions to the panel (can’t live without it - these days!)