GC - Quest Quick Links

On the quest pages, attaches to the images for each quest item a link to either the SDB if you have the item in your SDB, or the Shop Wizard.

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

// ==UserScript==
// @name         GC - Quest Quick Links
// @namespace    https://gf.qytechs.cn/en/users/1202961-twiggies
// @version      1.0
// @description  On the quest pages, attaches to the images for each quest item a link to either the SDB if you have the item in your SDB, or the Shop Wizard.
// @author       Twiggies
// @match        https://www.grundos.cafe/*/accept/
// @match        https://www.grundos.cafe/*/complete/
// @match        https://www.grundos.cafe/winter/snowfaerie/
// @match        https://www.grundos.cafe/winter/grundo/
// @match        https://www.grundos.cafe/halloween/witchtower/
// @match        https://www.grundos.cafe/halloween/braintree/
// @match        https://www.grundos.cafe/halloween/esophagor/
// @match        https://www.grundos.cafe/island/kitchen/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grundos.cafe
// @grant        none
// @license      MIT
// ==/UserScript==

let itemList;
if (window.location.href.endsWith('/accept/')) {
    itemList = document.querySelectorAll('div.itemList > div.shop-item')
}
else {
    itemList = document.querySelectorAll('div.quest-item');
}
if (itemList != undefined) {
    //Loop through each item
    for (let i = 0; i < itemList.length; i++) {
      let link = '';
      let sdbImg = itemList[i].querySelector('div.searchhelp a[href*="/safetydeposit/"] img');
      if (sdbImg != undefined) {
          //Check if the safety deposit box link has a checkmark.
          if (sdbImg.src.includes('_check')) {
              link = sdbImg.parentElement.href
          }
          //Otherwise, use the shop wizard link.
          else {
              link = itemList[i].querySelector('div.searchhelp a[href*="/wizard/"]').href;
          }
          //Set the image for this item to the link.
          const imgElem = itemList[i].querySelector('img')
          const linkElem = document.createElement('a');
          linkElem.href = link;
          linkElem.target = '_blank';
          linkElem.appendChild(imgElem.cloneNode(true));
          itemList[i].replaceChild(linkElem,imgElem);
      }

    }
}

QingJ © 2025

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