Toggle Auto Follow

Quickly toggle the 'Keep Current Pattern Selected' preference by pressing SHIFT + G

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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        Toggle Auto Follow
// @namespace   Jummbox Scripts
// @match       https://ultraabox.github.io/
// @match       https://aurysystem.github.io/goldbox/
// @match       https://jummb.us/
// @grant       GM_notification
// @version     1.4.1
// @author      PlanetBluto
// @description Quickly toggle the 'Keep Current Pattern Selected' preference by pressing SHIFT + G
// @license     MIT
// ==/UserScript==

const print = console.log

var inited = false

var toggleFunc = (elem, key) => {
    elem.value = key
    elem.dispatchEvent(new Event("change"))

    print(localStorage.getItem(key))
    GM_notification({"text": `switched to ${localStorage.getItem(key)}`, silent: true})
}

var int = setInterval(() => {
  var selectElem = document.querySelector(".selectContainer.menu.preferences > select")
  if (selectElem) {
    clearInterval(int)

    document.addEventListener("keydown", e => {
      if (e.which == 71 && e.shiftKey == true) {
        toggleFunc(selectElem, "autoFollow")
      }
    })
  }
}, 10)