Scribd Show Full Document Button

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

  1. // ==UserScript==
  2. // @name Scribd Show Full Document Button
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @license MIT
  6. // @description Adds a button to show full Scribd document content in a new window By chatgpt :)
  7. // @match *://www.scribd.com/document/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Retrieve the document ID from the URL
  15. const docIdMatch = window.location.href.match(/document\/(\d+)/);
  16. if (!docIdMatch) return;
  17.  
  18. const docId = docIdMatch[1];
  19.  
  20. // Find the Report button to insert the custom button nearby
  21. const referenceButton = document.querySelector("button.ButtonCore-module_wrapper_MkTb9s[data-e2e='report-content-button-sticky_metadata_column']");
  22.  
  23. if (referenceButton) {
  24. // Create the custom button
  25. const showFullButton = document.createElement("button");
  26. showFullButton.innerText = "Full Doc.";
  27. showFullButton.style.padding = "10px 15px";
  28. showFullButton.style.marginLeft = "10px"; // Add some space between buttons
  29. showFullButton.style.backgroundColor = "#4CAF50";
  30. showFullButton.style.color = "white";
  31. showFullButton.style.border = "none";
  32. showFullButton.style.borderRadius = "5px";
  33. showFullButton.style.cursor = "pointer";
  34.  
  35. // Add click event to open Scribd links in new windows
  36. showFullButton.onclick = function() {
  37. // Open the main Scribd document link
  38. window.open(`https://www.scribd.com/document/${docId}/All-My-Roblox-Ids`, '_blank');
  39.  
  40. // Open the embed content link
  41. window.open(`https://www.scribd.com/embeds/${docId}/content`, '_blank');
  42. };
  43.  
  44. // Insert the custom button after the Report button
  45. referenceButton.parentNode.insertBefore(showFullButton, referenceButton.nextSibling);
  46. }
  47. })();