See Through DPlayer

Display the video source link for DPlayer elements which have <video> elements under the hood.

  1. // ==UserScript==
  2. // @name See Through DPlayer
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description Display the video source link for DPlayer elements which have <video> elements under the hood.
  6. // @author firetree
  7. // @match *://*/*
  8. // @icon none
  9. // @grant GM_registerMenuCommand
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @license WTFPL
  13. // @require https://scriptcat.org/lib/513/2.0.0/ElementGetter.js#sha256=KbLWud5OMbbXZHRoU/GLVgvIgeosObRYkDEbE/YanRU=
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. elmGetter.each(".dplayer", document, el => {
  19. if (el.classList.contains("see-through-dplayer")) return
  20. let link = document.createElement("a")
  21. link.href = el.querySelector("video").src
  22. link.textContent = link.href
  23. link.target = '_blank'
  24. el.after(link)
  25. el.classList.add("see-through-dplayer")
  26. })
  27. })();