PDF Drive direct download

to skip the annoying wait before download.

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 or Violentmonkey 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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         PDF Drive direct download
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  to skip the annoying wait before download.
// @author       Kiwi Poon
// @match        *://www.pdfdrive.com/*.html
// @match        *://pdfdrive.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Get current url:
    console.log("Current URL: " + window.location.href);
    let url = window.location.href;

    // Check the url whether in download page current.
    if(url.match(/d[0-9]{3,11}.html/g)){

        console.log("This is a download page");
        // to show the download link
        document.getElementById("alternatives").style.display = "";
        document.getElementById("alternatives").style.textalign = "left";

        // hide the timer
        document.getElementById("broken").style.display = "none";

    // if the url isn't download page
    }else if(url.match(/e[0-9]{3,11}.html/g)){
        console.log("This is not a download page");

        // click the button automatically
        document.getElementById("download-button-link").click();
    }







})();