Nexus No Wait

Stay on current page and start slow download (support Manual/Vortex)

当前为 2019-12-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Nexus No Wait
  3. // @description Stay on current page and start slow download (support Manual/Vortex)
  4. // @namespace NexusNoWait
  5. // @include https://www.nexusmods.com/*/mods/*
  6. // @run-at document-idle
  7. // @version 1.1
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
  9. // ==/UserScript==
  10.  
  11.  
  12. $(document).on( 'click', '.btn', function( event ) {
  13. var href = $(this).attr('href');
  14. if (~href.indexOf("file_id")){
  15. event.preventDefault();
  16. $.get( href, function( data ) {
  17. var slow = $(data).find('#slowDownloadButton');
  18. var downloadUrl = slow.data('download-url');
  19. document.location.href = downloadUrl;
  20. });
  21. var popup = $(this).parent();
  22. if (popup.hasClass('popup')){
  23. popup.children("button").click();
  24. }
  25. $(this).css("color", "green");
  26. $(this).text('LOADING');
  27. }
  28. });