GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [html] 第134天 Web Worker线程的限制是什么? · Issue #1120 · haizlin/fe-interview

[html] 第134天 Web Worker线程的限制是什么? #1120

New issue
Copy link
New issue
Copy link
Open
Open
[html] 第134天 Web Worker线程的限制是什么?#1120
Copy link
Labels
htmlhtml

Description

@haizhilin2013
haizhilin2013
opened on Aug 27, 2019
Issue body actions

第134天 Web Worker线程的限制是什么?

Activity

  1. haizhilin2013
    added
    htmlhtml
    on Aug 27, 2019
  2. nowherebutup commented on Aug 28, 2019

    @nowherebutup
    nowherebutup
    on Aug 28, 2019
    More actions
    1. IE不支持
    2. 无法访问window.location对象
  3. qhdxwdm commented on Aug 28, 2019

    @qhdxwdm
    qhdxwdm
    on Aug 28, 2019
    More actions

    (1)同源限制

    分配给 Worker 线程运行的脚本文件,必须与主线程的脚本文件同源。

    (2)DOM 限制

    Worker 线程所在的全局对象,与主线程不一样,无法读取主线程所在网页的 DOM 对象,也无法使用document、window、parent这些对象。但是,Worker 线程可以navigator对象和location对象。

    (3)通信联系

    Worker 线程和主线程不在同一个上下文环境,它们不能直接通信,必须通过消息完成。

    (4)脚本限制

    Worker 线程不能执行alert()方法和confirm()方法,但可以使用 XMLHttpRequest 对象发出 AJAX 请求。

    (5)文件限制

    Worker 线程无法读取本地文件,即不能打开本机的文件系统(file://),它所加载的脚本,必须来自网络。

    Reacted by TanKingKhun, S.F., Old won, Bowen, biu-biu, mister.z, abueavan, luckyMuChen, xie yuhui, creater and 1 more
  4. d4c-27 commented on Apr 6, 2022

    @d4c-27
    d4c-27
    on Apr 6, 2022
    More actions

    内部代码不能操作DOM因为this不是window、不能跨域加载js、不是所有浏览器都能支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    htmlhtml

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.