Pornhub Playlists Relocate

Relocates the recommended playlists from the bottom of the page to under the video

  1. // ==UserScript==
  2. // @name Pornhub Playlists Relocate
  3. // @description Relocates the recommended playlists from the bottom of the page to under the video
  4. // @version 1.0
  5. // @namespace AceDOne
  6. // @author AceDOne
  7. // @match *://www.pornhub.com/*
  8. // @grant None
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to move an element above another element and resize it
  15. function moveAndResizeElement(targetSelector, destinationSelector) {
  16. var targetElement = document.querySelector(targetSelector);
  17. var destinationElement = document.querySelector(destinationSelector);
  18.  
  19. if (targetElement && destinationElement) {
  20. // Move the target element above the destination element
  21. destinationElement.parentNode.insertBefore(targetElement, destinationElement);
  22.  
  23. // Adjust styles to ensure the target element is visible
  24. targetElement.style.position = 'relative';
  25. targetElement.style.zIndex = '9999'; // Ensure it's above other elements if needed
  26. targetElement.style.marginBottom = '20px'; // Adjust margin as needed
  27. }
  28. }
  29.  
  30. // Wait for the document to be fully loaded
  31. window.addEventListener('load', function() {
  32. // Define the selectors
  33. var targetSelector = '.playlist-listingSmall.user-playlist.videos';
  34. var destinationSelector = '.video-actions-container';
  35.  
  36. // Move and resize the target element
  37. moveAndResizeElement(targetSelector, destinationSelector);
  38. });
  39.  
  40. // Add custom styles for the resized element
  41. GM_addStyle(`
  42. .playlist-listingSmall.user-playlist.videos {
  43. width: 90% !important; /* Adjust width as needed */
  44. max-width: 600px !important; /* Adjust max width as needed */
  45. background-color: #f9f9f9; /* Example: set background color for visibility */
  46. padding: 10px; /* Example: add padding for spacing */
  47. }
  48. `);
  49. })();