Scribd Free Reader

Open Scribd documents in full-screen (Embed Mode) with just a single click.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Scribd Free Reader
// @namespace    http://tampermonkey.net/
// @version      2.1
// @description  Open Scribd documents in full-screen (Embed Mode) with just a single click.
// @author       htrnguyen
// @match        https://www.scribd.com/document/*
// @match        https://www.scribd.com/doc/*
// @icon         https://raw.githubusercontent.com/htrnguyen/my-user-scripts/main/scripts/scribd-free-reader/logo.png
// @grant        none
// ==/UserScript==

(function () {
  "use strict";

  const ICON_READ = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>`;

  const createButton = () => {
    if (document.getElementById("scribd-free-reader-btn")) return;

    const btn = document.createElement("button");
    btn.id = "scribd-free-reader-btn";
    btn.innerHTML = ICON_READ;
    btn.title = "Read Full Screen";

    Object.assign(btn.style, {
      position: "fixed",
      bottom: "20px",
      right: "20px",
      zIndex: "9999",
      width: "50px",
      height: "50px",
      borderRadius: "50%",
      border: "none",
      background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
      boxShadow: "0 4px 6px rgba(0,0,0,0.1)",
      cursor: "pointer",
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      transition: "transform 0.2s, box-shadow 0.2s",
    });

    btn.onmouseenter = () => {
      btn.style.transform = "translateY(-2px)";
      btn.style.boxShadow = "0 6px 8px rgba(0,0,0,0.2)";
    };
    btn.onmouseleave = () => {
      btn.style.transform = "translateY(0)";
      btn.style.boxShadow = "0 4px 6px rgba(0,0,0,0.1)";
    };

    btn.onclick = () => {
      const match = window.location.href.match(/(?:document|doc)\/(\d+)/);
      if (match && match[1]) {
        const embedUrl = `https://www.scribd.com/embeds/${match[1]}/content`;
        window.open(embedUrl, "_blank");
      } else {
        alert("Document ID not found.");
      }
    };

    document.body.appendChild(btn);
  };

  // Init
  createButton();

  // Handle SPA navigation
  let lastUrl = location.href;
  new MutationObserver(() => {
    if (location.href !== lastUrl) {
      lastUrl = location.href;
      setTimeout(createButton, 1000);
    }
  }).observe(document.body, { childList: true, subtree: true });
})();