Add Quicklink to every webpage to preload links you're likely to click. This can speed up loading times.
目前為
// ==UserScript==
// @name Quicklink Loader
// @match *://*/*
// @grant none
// @version 1.1.1
// @author NoUser
// @description Add Quicklink to every webpage to preload links you're likely to click. This can speed up loading times.
// @namespace https://greasyfork.org/en/scripts/459274-quicklink-loader
// @homepage https://greasyfork.org/en/scripts/459274-quicklink-loader
// @require https://cdnjs.cloudflare.com/ajax/libs/quicklink/2.3.0/quicklink.umd.js
// @license MIT
// ==/UserScript==
// Test on
// https://mini-ecomm.glitch.me/
const ignore = [
// Ignore all api urls
/\/api\/?/,
/^api\./,
// Ignore login/signup urls
/\/(sign|log)\/?/,
// Ignore urls that contain the word "video"
uri => uri.includes('video'),
// Don't prefetch links with dom selectors
uri => uri.includes('#'),
// Don't prefetch these file types
uri => ['.zip', '.tar.gz', '.json', '.apk', '.xapk', '.woff2', '.tff', '.otf'].some(ext => uri.includes(ext)),
// Don't prefetch these protocols
uri => ['http:', 'file:', 'ftp:', 'mailto:', 'tel:'].some(protocol => uri.includes(protocol)),
// Ignore all links, scripts which has explicit noprefetch
(uri, elem) => elem.hasAttribute('noprefetch'),
];
quicklink.listen({ origins: true, limit: 15, ignores: ignore });