Fix runtime injection in Web Worker.

Web Workers don't have `window` object but they have `self` (which is available in regular windows as well).