SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- requestIdleCallback(() => {
- fetch("xxx/a.html").then(res => res.text()).then(html => {
- const reg = /target*.js/gi;
- const scripts = html.match(reg);
- if(scripts && scripts.length) {
- scripts.forEach(src => {
- const link = document.createElement("link");
- link.rel = "prefetch";
- link.href = src;
- document.head.appendChild(link);
- });
- }
- })
- }, { timeout: 1000 * 5 })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.