Jsoo: detect if we are a window/iframe or a webworker

Is there a way in jsoo to detect if we are (1) a window/iframe or (2) a webworker ?

The goal is to have util functions that can do things like postMessage, setTimeout, fetch, … regardless if we are a window or a webworker.

If you are using brr you can checkout the result of Brr_webworkers.Worker.ami (). If not I’ll let you check out how it’s implemented.

1 Like