Můžete načíst webcomponents z jiných domén?
Dostávám cors chyba ve firefoxu/linux.
Přidal jsem to na nginx, ale stále nemůže načíst:
add_header Access-Control-Allow-Origin *;
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="module" src="//briskreader.com/components/feed-list.js"></script>
</head>
<body>
<feed-list topic="bitcoin"></feed-list>
</body>
</html>
Tady je chyba:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://briskreader.com/components/feed-list.js. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Loading module from “http://briskreader.com/components/feed-list.js” was blocked because of a disallowed MIME type (“text/html”).
test.html
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://briskreader.com/components/feed-list.js. (Reason: CORS request did not succeed).
Heres záhlaví od briskreader.com:
$ curl -I 'https://briskreader.com/components/feed-list.js'
HTTP/2 200
server: nginx/1.18.0 (Ubuntu)
date: Sun, 21 Nov 2021 06:30:51 GMT
content-type: application/javascript
content-length: 2187
expires: Sun, 21 Nov 2021 06:30:50 GMT
cache-control: no-cache
cache-control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0
access-control-allow-origin: *
accept-ranges: bytes