@WilliamPorter this code does work. But my concern is that it is constrained to a component/page level and therefore has to be copied and pasted everywhere you want to use it.
I was hoping someone could help us figure out how to do it sitewide, but I haven’t gotten a response to my post either.