初始化fy

This commit is contained in:
yziiy
2025-08-11 11:51:38 +08:00
parent 98ce20e897
commit 7e21160e13
19770 changed files with 3108698 additions and 0 deletions

26
uni_modules/UniDevTools/node_modules/licia/prefetch.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
function prefetchByLink(url) {
return new Promise(function(resolve, reject) {
var link = document.createElement('link');
link.rel = 'prefetch';
link.href = url;
link.onload = resolve;
link.onerror = reject;
document.head.appendChild(link);
});
}
function prefetchByXhr(url) {
return new Promise(function(resolve, reject) {
var req = new XMLHttpRequest();
req.open('GET', url, (req.withCredentials = true));
req.onload = function() {
req.status === 200 ? resolve() : reject();
};
req.send();
});
}
var link = document.createElement('link');
var supportLink =
(link.relList || {}).supports && link.relList.supports('prefetch');
exports = supportLink ? prefetchByLink : prefetchByXhr;
module.exports = exports;