New PLan: Wattpad viewer

Removing Wattpad's force log in page

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         New PLan: Wattpad viewer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removing Wattpad's force log in page
// @author       RAVEN
// @include      https://www.wattpad.com/*
// @include      http://www.wattpad.com/*
// @include      https://embed.wattpad.com/
// @include      http://embed.wattpad.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=wattpad.com
// @grant        none
// @license      none
// ==/UserScript==


function wait(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

async function runSixteenTimes() {
  for (let i = 0; i < 16; i++) {
    document.body.style.overflow = "visible";
    document.querySelectorAll('#modals').forEach(el => el.remove());
    document.querySelectorAll('div.uWKBG.kKnZc.UCQAd').forEach(el => el.remove());
    document.querySelectorAll('.modal-backdrop.fade.in').forEach(el => el.remove());
    console.log(`Run ${i + 1}: overflow set to visible`);

    if (i < 15) {
      await wait(200); // Wait 10 seconds between runs, but not after the last one
    }
  }
}

runSixteenTimes();