0.0.5 • Published 7 years ago

cross-domain-worker-url v0.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

cross-domain-worker-url

Convert a cross-domain url to an available url.

If your current domain is http://www.a.com/, but you want to try const myWorker = new Worker('http://www.b.com/hello.js'), it will throw cross-domain error.

We can solve the problem by using cross-domain-worker-url
import { getLocalWorkerUrl } from 'cross-domain-worker-url';

// If in async function, you can use in this way:
// const localWorkerUrl = await getLocalWorkerUrl(originWorkerUrl);
getLocalWorkerUrl(originWorkerUrl).then(localWorkerUrl => {
    const myWorker = new Worker(localWorkerUrl);
});

MIT Licenced

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago