언어 설정

Menu
Sites
Language
Cannot use webapis at web worker?

Hi guys,

I want to use webapis at web worker, but webapis belongs window object.

How can i use webapis? thanks.

Responses

1 댓글
AVSukhov

Hello,

Workers use a same-origin policy and therefore using some of the browser resources, such as DOM, document, window, and parent, is not possible, and they must be activated by creating separate JavaScript files. However, ECMA JavaScript and methods included in Web Workers API, such as postMessage(), location, navigator, and importScripts() can be used. The self and location attributes are also supported.