Unfortunately it doesn't seem to work for me even in play mode. That temporary script works well enough though. I think with a combination of non-camera canvases and the script I should be able to manage.
A non-UI version of the script would also be very helpful if you find the time!