Quicklink Loader

Add Quicklink to every webpage to preload links you're likely to click. This can speed up loading times.

当前为 2023-02-02 提交的版本,查看 最新版本

// ==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://gf.qytechs.cn/en/scripts/459274-quicklink-loader
// @homepage    https://gf.qytechs.cn/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 });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址