Greasy Fork is available in English.

Freeship

Unlock all Fireship PRO courses/lessons.

Verze ze dne 26. 03. 2024. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Freeship
  3. // @namespace lemons
  4. // @version 1.7
  5. // @description Unlock all Fireship PRO courses/lessons.
  6. // @author lemons
  7. // @match https://fireship.io/*
  8. // @icon https://em-content.zobj.net/source/apple/391/fire_1f525.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. setInterval(async () => {
  13. document.querySelectorAll("[free=\"\"]").forEach(el => el.setAttribute("free", true)) // set all elements with the attribute free set to "" to true
  14.  
  15. if (document.querySelector("if-access [slot=\"granted\"]")) { // replace HOW TO ENROLL to YOU HAVE ACCESS
  16. document.querySelector("if-access [slot=\"denied\"]").remove()
  17. document.querySelector("if-access [slot=\"granted\"]").setAttribute("slot", "denied")
  18. }
  19.  
  20. if (document.querySelector("video-player")?.shadowRoot?.querySelector(".vid")?.innerHTML) return; // return if no video player
  21. const vimeoId = Number(atob(document.querySelector("global-data").vimeo)); // get id for vimeo video
  22. const youtubeId = atob(document.querySelector("global-data").youtube); // get id for vimeo video
  23.  
  24. if (youtubeId) { // if there is an id,
  25. document.querySelector("video-player").setAttribute("free", true) // set free to true
  26. document.querySelector("video-player").shadowRoot.querySelector(".vid").innerHTML = `<iframe src="https://youtube.com/embed/${youtubeId}" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen="" title="${location.pathname.split("/")[3]}" width="426" height="240" frameborder="0"></iframe>` // set video
  27. return;
  28. }
  29. if (vimeoId) { // if there is an id,
  30. document.querySelector("video-player").setAttribute("free", true) // set free to true
  31. const html = (await fetch(`https://vimeo.com/api/oembed.json?url=https%3A%2F%2Fvimeo.com%2F${vimeoId}&id=${vimeoId}`).then(r=>r.json())).html
  32. document.querySelector("video-player").shadowRoot.querySelector(".vid").innerHTML = html // set video
  33. return;
  34. }
  35. }, 100)