fixing shadowRoot compatibility code to support new chrome versions