Giter Site home page Giter Site logo

Comments (8)

Acconut avatar Acconut commented on May 27, 2024

Thanks for the report! You are right that window does not exist in the environment for Web Workers. Maybe we should use self instead for detecting support: https://developer.mozilla.org/en-US/docs/Web/API/Window/self and https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/self

The following code could be a replacement without depending on window, although I didn't test it yet:

const isSupported = typeof self !== undefined && 'XMLHttpRequest' in self && 'Blob' in self && typeof Blob.prototype.slice === 'function'

Could you try it out and open a PR if it works?

from tus-js-client.

rashyad avatar rashyad commented on May 27, 2024

Tested your code and it works fine with worker. The test-node and test-puppeteer run just fine.
However, I did not manage to create a specific demo for worker or a specific test for worker.

Here is my PR #660

from tus-js-client.

rashyad avatar rashyad commented on May 27, 2024

May I know the status of this? Anything that I need to do on my side?

from tus-js-client.

Acconut avatar Acconut commented on May 27, 2024

I didn't have the time yet to try it out but I plan on doing so in the next few days

from tus-js-client.

jtag05 avatar jtag05 commented on May 27, 2024

I would also love to get this merged if it would solve this issue. If any additional help is required, I'm happy to lend a hand.

from tus-js-client.

Acconut avatar Acconut commented on May 27, 2024

I added a few more commits to your PR and merged it. Can you please test the latest main branch from GitHub and let me know if it works? If so, I can release a new version.

from tus-js-client.

rashyad avatar rashyad commented on May 27, 2024

Tested the main branch locally and works fine using with worker

from tus-js-client.

Acconut avatar Acconut commented on May 27, 2024

Thanks for the confirmation! I just published v4.0.1, which includes this patch.

from tus-js-client.

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.