Skip to content

Update request for "quicklink" library to fix CORS errors #419

Open
@giorgiopellegrino

Description

@giorgiopellegrino

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:

image

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:

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions