Quicklink Loader

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

Från och med 2023-02-02. Se den senaste versionen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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 });