Greasyfork Require Easy Get Latest Version

Puts the link for the latest version of a library into an input with autoselect instead of a code tag.

  1. // ==UserScript==
  2. // @name Greasyfork Require Easy Get Latest Version
  3. // @description Puts the link for the latest version of a library into an input with autoselect instead of a code tag.
  4. // @namespace Tobbe
  5. // @author Tobbe
  6. // @version 1.4
  7. //
  8. // @include https://greatest.deepsurf.us/*/scripts/*
  9. //
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
  11. //
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. var scriptLink = $('#script-content > p > code:first-child');
  17.  
  18. if(scriptLink) {
  19. var input = $('<input type="text" style="width: 100%" readonly="readonly">');
  20. input.val(scriptLink.html()).focus(function() { $(this).select(); });
  21.  
  22. scriptLink.replaceWith(input);
  23. }
  24. })();