Git Product home page Git Product logo

Comments (5)

wuxc avatar wuxc commented on July 17, 2024

同样的问题。 @Yang1998-jiale 请问有解决么?

from wujie.

Yang1998-jiale avatar Yang1998-jiale commented on July 17, 2024

同样的问题。 @Yang1998-jiale 请问有解决么?

没得呢 分析原因可能是请求的worker的资源在子应用 但是因为无界导致去主应用里找了

from wujie.

myhighland avatar myhighland commented on July 17, 2024

最简单的方案是 父子应用使用nginx代理在同一域名下 直接解决跨域问题 另外一种方案是通过webpack或者window添加环境便令等对worker运行环境进行修改 但需要对子应用环境进行区分

from wujie.

Longleggedmouse avatar Longleggedmouse commented on July 17, 2024

worker 加载js脚本时跨域问题,解决方式有几种,webpack配置上使用worker-loader,或者是获取脚本内容后,创建blob使用createObjectURL的方式

from wujie.

yiludege avatar yiludege commented on July 17, 2024

对于文webworker,是无法在跨域环境下运行的,可以worker的url改造一下变成 blob对象就可以不用跨域了

const workerUrl =window. POWERED_BY_WUJIE ? URL.createObjectURL(new Blob([importScripts('${url}')], { type: 'text/javascript' })) : url;

const worker = new Worker(workerUrl);

from wujie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.