It took a while, but I’ve managed to come up with a solution that works both locally and online without switching to a Both code component.