templates: Fix browsed object metadata availability from javascript
That regression was introduced in 8e0fa87b22d7.