Wrap window if shadow DOM polyfill is used