🏠 Home 

SurferSEO Copy Words Limit

Adds a button to copy text automatically from the specified div on SurferSEO drafts page


Install this script?
  1. // ==UserScript==
  2. // @name SurferSEO Copy Words Limit
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Adds a button to copy text automatically from the specified div on SurferSEO drafts page
  6. // @author mhshan
  7. // @match https://app.surferseo.com/drafts/*
  8. // @grant GM_setClipboard
  9. // @license MIT
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. // Wait until the page is fully loaded
  14. window.addEventListener('load', function() {
  15. // Create a button to copy the text
  16. const copyButton = document.createElement('button');
  17. copyButton.textContent = 'Copy Words Limit';
  18. copyButton.style.position = 'absolute'; // Position the button where you want
  19. copyButton.style.top = '10px'; // You can adjust the position as needed
  20. copyButton.style.right = '650px';
  21. copyButton.style.padding = '10px';
  22. copyButton.style.backgroundColor = '#3ccf4e';
  23. copyButton.style.color = '#fff';
  24. copyButton.style.border = 'none';
  25. copyButton.style.cursor = 'pointer';
  26. copyButton.style.fontSize = '14px';
  27. copyButton.style.borderRadius = '5px';
  28. copyButton.style.zIndex = '1000';
  29. // Append the button to the body
  30. document.body.appendChild(copyButton);
  31. // Add click event listener to the button
  32. copyButton.addEventListener('click', function() {
  33. // Get the text content from the div
  34. const textToCopy = document.querySelector('.StructuralGuidelinesstyled__StructuralGuidelineRange-sc-1mxtki-1.eGzjqM').textContent;
  35. // Copy the text to the clipboard
  36. GM_setClipboard(textToCopy);
  37. });
  38. });
  39. })();