Scribd Show Full Document Button

Adds a button to show full Scribd document content in a new window By chatgpt :)

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Scribd Show Full Document Button
// @namespace    http://tampermonkey.net/
// @version      1.2
// @license      MIT
// @description  Adds a button to show full Scribd document content in a new window By chatgpt :)
// @match        *://www.scribd.com/document/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Retrieve the document ID from the URL
    const docIdMatch = window.location.href.match(/document\/(\d+)/);
    if (!docIdMatch) return;

    const docId = docIdMatch[1];

    // Find the Report button to insert the custom button nearby
    const referenceButton = document.querySelector("button.ButtonCore-module_wrapper_MkTb9s[data-e2e='report-content-button-sticky_metadata_column']");

    if (referenceButton) {
        // Create the custom button
        const showFullButton = document.createElement("button");
        showFullButton.innerText = "Full Doc.";
        showFullButton.style.padding = "10px 15px";
        showFullButton.style.marginLeft = "10px"; // Add some space between buttons
        showFullButton.style.backgroundColor = "#4CAF50";
        showFullButton.style.color = "white";
        showFullButton.style.border = "none";
        showFullButton.style.borderRadius = "5px";
        showFullButton.style.cursor = "pointer";

        // Add click event to open Scribd links in new windows
        showFullButton.onclick = function() {
            // Open the main Scribd document link
            window.open(`https://www.scribd.com/document/${docId}/All-My-Roblox-Ids`, '_blank');

            // Open the embed content link
            window.open(`https://www.scribd.com/embeds/${docId}/content`, '_blank');
        };

        // Insert the custom button after the Report button
        referenceButton.parentNode.insertBefore(showFullButton, referenceButton.nextSibling);
    }
})();