Dcard guest popup dismiss

Dismiss the annoying login request pop-up and unlock scrolling restriction while not logging in.

目前为 2021-09-16 提交的版本。查看 最新版本

// ==UserScript==
// @name            Dcard guest popup dismiss
// @name:ZH-TW      Dcard 訪客瀏覽腳本
// @namespace       com.sherryyue.dcardguestmode
// @version         0.3
// @description     Dismiss the annoying login request pop-up and unlock scrolling restriction while not logging in.
// @author          SherryYue
// @match           *://*.dcard.tw/*
// @contributionURL https://sherryyuechiu.github.io/card
// @supportURL      [email protected]
// @icon            https://sherryyuechiu.github.io/card/images/logo/maskable_icon_x96.png
// @grant           none
// ==/UserScript==

(function () {
  'use strict';
  /** login reqquest popup
   * @type HTMLElement */
  var $loginRequestPopup;

  /** if popup exsist, dismiss it. */
  var loginPopupTraker = () => {
    $loginRequestPopup = document.querySelector(".__portal>*");
    if ($loginRequestPopup) {
      breakRestriction();
    }
  }

  /** dismiss the popup and break the scrolling restriction */
  var breakRestriction = () => {
    // hide login reqquest popup
    $loginRequestPopup.style.display = "none";
    // unlock scrolling restriction
    document.body.style.overflow = "auto";
  }

  // detect every 0.5 seconds
  setInterval(loginPopupTraker, 500);
})();

QingJ © 2025

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