GoogleChromeLabs / GoogleChromeLabs/quicklink

How to solve the CORS of prefetcher

Open
#170 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
11.3k
Forks
429
PR merge metrics
No merged PRs in 30d

Description

I want to grab the hyperlink image and video link of the current page.
my configuration is as follows:
`
window.addEventListener('load', () => {
let imgSrcs = [];
let imgs = document.getElementsByTagName('img');
for (let i = 0; i < imgs.length; i++) {
imgSrcs.push(imgs[i].src)
};
let videoSrcs = [];
let videos = document.getElementsByTagName('video');
for (let i = 0; i < videos.length; i++) {
videoSrcs.push(videos[i].src)
};
let aLinks = [];
let links = document.getElementsByTagName('a');
for (let i = 0; i < links.length; i++) {
aLinks.push(links[i].href)
};
let urlss = imgSrcs.concat(videoSrcs, aLinks);
quicklink.prefetch(urlss,true);
});

`
the hyperlink including some other domains
i have enables CORS on Server
i have used this method by this link https://enable-cors.org/server_nginx.html
But still failed.
so `quicklink.prefetch()` can provide the CORS option ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.