diff --git a/src/uv.handler.js b/src/uv.handler.js index 64bf3bb..4ba612c 100644 --- a/src/uv.handler.js +++ b/src/uv.handler.js @@ -700,10 +700,13 @@ function __uvHook(window, config = {}, bare = '/bare/') { }, }); - const contentWindowGet = Object.getOwnPropertyDescriptor( - HTMLIFrameElement.prototype, - 'contentWindow' - ).get; + // HTMLIFrameElement may not be defined (workers) + const contentWindowGet = + HTMLIFrameElement && + Object.getOwnPropertyDescriptor( + HTMLIFrameElement.prototype, + 'contentWindow' + ).get; function uvInject(that) { const win = contentWindowGet.call(that);