[w3c/webcomponents] Resolve the worker path within a link rel="import" (#651)

If you've a worker within a ```<link rel="import">``` then its address will be resolved without taking in count CORS.

Let's suppose the following:
_index.html_ (from //localhost)
```html
<!doctype html>
<html>
  <head>
    <link rel="import" href="//far-away.co/import.html">
  </head>
</html>
```

_//far-away.co/import.html_
```html
<!doctype html>
<html>
  <head>
    <script src="script.js"></script>
  </head>
</html>
```

_script.js_
```javascript
'use strict';
new Worker('a-worker.js');
```

I see that browser resolves the _script.js_ from ```//far-away.co/script.js```, but the worker won't resolve as expected. Browser will resolve its address from ```//localhost/a-worker.js``` instead of ```//far-away.co/a-worker.js```.

What the spec states about the worker's URL?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/651

Received on Saturday, 22 July 2017 12:27:29 UTC