Fix src of Flash content

Internet Archive

  1. // ==UserScript==
  2. // @name Fix src of Flash content
  3. // @namespace https://greasyfork.org/users/19523
  4. // @description Internet Archive
  5. // @match http://web.archive.org/web/*/*
  6. // @match https://web.archive.org/web/*/*
  7. // @version 0.13
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11.  
  12. (function () {
  13. var embeds = document.querySelectorAll('embed[src$=".swf"]');
  14. var i = 0;
  15. (function rewriteSrc(embed) {
  16. if (!embed) {
  17. return;
  18. }
  19. if (embed.src.match(/\/\d{14,}\//)) {
  20. embed.src = embed.src.replace(/(\/\d{14,})\//, '$1im_/');
  21. }
  22. setTimeout(function () { rewriteSrc(embeds[++i]) }, 500);
  23. })(embeds[i]);
  24. })();