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

Greasy fork 爱吃馍镜像

PDF.js Direct Downloader

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

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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

公众号二维码

扫码关注【爱吃馍】

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

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

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

公众号二维码

扫码关注【爱吃馍】

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

Tác giả
skl49
Cài đặt hàng ngày
0
Số lần cài đặt
12
Đánh giá
0 0 0
Phiên bản
1.0
Đã tạo
18-08-2025
Đã cập nhật
18-08-2025
Kích thước
2 KB
Giấy phép
MIT
Áp dụng cho
Tất cả trang web

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.