worker-loader icon indicating copy to clipboard operation
worker-loader copied to clipboard

use sharedWorker inline has the same filename

Open huyansheng3 opened this issue 3 years ago • 2 comments

the sharedworker for mutile tab,when every time inline URL.createObjectURL will produce new hash url, every tab will has a new sharedworker.

const source = 'importScript("https://anotherhost/worker.js")';
const url = 'data:application/javascript;base64,' + btoa(source);
const worker = new SharedWorker(url);

Base64 encoding gives a permanent URL until the source code changes. maybe should support this ?

  • Operating System:
  • Node Version:
  • NPM Version:
  • webpack Version:
  • worker-loader Version:

Feature Proposal

Feature Use Case

huyansheng3 avatar Jul 08 '21 10:07 huyansheng3

What is webpack version?

alexander-akait avatar Jul 12 '21 09:07 alexander-akait

How about webpack@4. I have the same scenes to use SharedWorker with same url, when i want to use inline mode. SharedWorker need same origin to fetch without login in worker.js.

Bdlhy avatar Sep 03 '21 02:09 Bdlhy