portalgraphics HTML5 Drawing Procedure

Replaces Flash-based portalgraphics drawing procedure display with a video tag

  1. // ==UserScript==
  2. // @name portalgraphics HTML5 Drawing Procedure
  3. // @namespace DoomTay
  4. // @description Replaces Flash-based portalgraphics drawing procedure display with a video tag
  5. // @include http://*.archive.org/web/*/http://www.portalgraphics.net/pg/illust/?image_id=*
  6. // @include http://*.archive.org/web/*/http://portalgraphics.net/pg/illust/?image_id=*
  7. // @include https://*.archive.org/web/*/http://www.portalgraphics.net/pg/illust/?image_id=*
  8. // @include https://*.archive.org/web/*/http://portalgraphics.net/pg/illust/?image_id=*
  9. // @version 1.0.0
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var picID = window.location.href.substring(window.location.href.indexOf("=") + 1);
  14. var IDRounded = picID >= 1000 ? Math.floor(picID/1000)*1000 : "0000";
  15. var flashVid = document.querySelector("#ill-de-illust-m > div > object");
  16. var timestamp = /web\/(\d{1,14})/.exec(window.location.href)[1];
  17.  
  18. if(flashVid)
  19. {
  20. var eventVid = document.createElement("video");
  21. eventVid.width = flashVid.width;
  22. eventVid.height = flashVid.height;
  23. eventVid.controls = "true";
  24. eventVid.src = "/web/" + timestamp + "/http://www.portalgraphics.net/data/movie/" + IDRounded + "/" + picID + ".mp4";
  25. eventVid.poster = "/web/" + timestamp + "/http://www.portalgraphics.net/data/image/resize/" + IDRounded + "/" + picID + ".jpg";
  26. flashVid.parentNode.replaceChild(eventVid,flashVid);
  27. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址