Description
Hi @gilbertococchi @addyosmani ,
I am contacting you to ask for an update of the “quicklink” library in order to solve a problem related to CORS errors during resource prefetching.
Specifically, I would like to have the attribute “crossorigin=”anonymous“” added while the prefetch link element is added to the DOM in the “src/prefetch.mjs” file. This is the updated code I would like to implement:
The reason for this change is to ensure that prefetched resources are not treated as opaque resources but as cors resources, thus avoiding possible CORS errors when they are retrieved from the cache.
Here is an example of the error that currently occurs when a prefetched resource is called from the cache:
Alternatively, one solution might be to allow the user to choose whether to add the “cross-origin” attribute using the API. An example of a call could be:
quicklink.prefetch("URLResource", false, {crossorigin:"anonymous"});
Thank you for your attention and timely resolution of this issue.
Sincerely yours,
Giorgio Pellegrino.