🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

PDF.js Direct Downloader

Adds a download button to PDF.js viewers that saves the original PDF file

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Autor
skl49
Installationen heute
0
Installationen gesamt
12
Bewertungen
0 0 0
Version
1.0
Erstellt am
18.08.2025
Letzte Aktualisierung
18.08.2025
Größe
1,88 KB
Lizenz
MIT
Wird angewandt auf
Alle Seiten

PDF.js Direct Downloader

PDF.js Direct Downloader adds a convenient Download PDF button to any webpage that uses PDF.js as its PDF viewer.

Normally, some websites hide or disable the download option in PDF.js, making it difficult to save the original file. This script fixes that by injecting a button that lets you download the currently opened PDF directly from your browser.


✨ Features

  • ✅ Detects if a page is using PDF.js
  • ✅ Adds a floating “Download PDF” button in the top-right corner of the screen
  • ✅ Saves the PDF as a file (document.pdf) with one click
  • ✅ Works even if the site’s native download button is disabled or hidden
  • ✅ Lightweight and runs automatically

📌 How It Works

  • The script waits until PDF.js is loaded on the page.
  • Once detected, it inserts a custom button in the corner of the viewer.
  • When clicked, it uses the PDF.js API to extract the binary PDF data and triggers a browser download.
  • The file will be saved as document.pdf by default.

⚠️ Limitations

  • Currently, the filename is always document.pdf.
  • Some websites may override or customize PDF.js in ways that break detection.
  • If a site doesn’t use PDF.js, the button will not appear.

🛠️ Compatibility

  • Works in Chrome, Firefox, Edge, and other browsers with Tampermonkey.
  • Should work on any website that embeds PDFs with PDF.js.