Vault ROM Restore

Restores the download and play online button to Vimm's Vault games.

  1. // ==UserScript==
  2. // @name Vault ROM Restore
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Restores the download and play online button to Vimm's Vault games.
  6. // @author InariOkami
  7. // @icon https://vimm.net/images/vimmbutton-100.png
  8. // @match https://vimm.net/vault/*
  9. // @grant GM_log
  10. // ==/UserScript==
  11.  
  12. const linesToDetect = [
  13. "Download, box art, and screen shots unavailable at the request of Nintendo of America",
  14. "Download unavailable at the request of Nintendo of America",
  15. "Download unavailable at the request of the Entertainment Software Association",
  16. "Download, box art, and screen shots unavailable at the request of the Entertainment Software Association",
  17. "Download unavailable at the request of Sega Corporation",
  18. "Download, box art, and screen shots unavailable at the request of Sega Corporation",
  19. "Download unavailable at the request of LEGO Juris A/S",
  20. "Download, box art, and screen shots unavailable at the request of LEGO Juris A/S"
  21. ];
  22.  
  23. let lineDetected = linesToDetect.find(line => document.body.innerHTML.includes(line));
  24.  
  25. if (lineDetected) {
  26. let system = window.location.pathname.split('/')[2];
  27.  
  28. let media = typeof allMedia !== "undefined" && allMedia.length > 0 ? allMedia[allMedia.length - 1] : null;
  29.  
  30. if (media) {
  31. let buttonHTML = `<table style="width:100%">
  32. <tbody>
  33. <tr id="download-row">
  34. <td style="width:33%"></td>
  35. <td style="width:34%">
  36. <form action="https://download${system === "Wii" ? 2 : 3}.vimm.net/download/" method="POST" id="download_form">
  37. <input type="hidden" name="mediaId" value="${media.ID}">
  38. <button type="submit" style="width:100%">Download</button>
  39. </form>
  40. </td>
  41. <td style="width:33%; text-align:center" id="download_size">${media.ZippedText}</td>
  42. </tr>
  43. </tbody>
  44. </table>`;
  45.  
  46. if (system !== "Wii") {
  47. buttonHTML += `<button type="button" title="Play Online" onclick="location.href='/vault/?p=play&mediaId=${media.ID}'" style="width:33%">Play Online</button>`;
  48. }
  49.  
  50. document.body.innerHTML = document.body.innerHTML.replace(lineDetected, buttonHTML);
  51. } else {
  52. console.error("Media data is undefined or empty.");
  53. }
  54. }