Freeship

Unlock all Fireship PRO courses/lessons.

As of 2024-03-07. See the latest version.

  1. // ==UserScript==
  2. // @name Freeship
  3. // @namespace lemons
  4. // @version 1.5
  5. // @description Unlock all Fireship PRO courses/lessons.
  6. // @author lemons
  7. // @match https://fireship.io/*
  8. // @icon https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/325/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)) - Number(document.querySelector("head").getAttribute("data-build")); // get id for vimeo video
  22. const youtubeId = atob(document.querySelector("global-data").youtube); // get id for vimeo video
  23.  
  24. if (vimeoId) { // if there is an id,
  25. document.querySelector("video-player").setAttribute("free", true) // set free to true
  26. 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
  27. document.querySelector("video-player").shadowRoot.querySelector(".vid").innerHTML = html // set video
  28. }
  29. if (youtubeId) { // if there is an id,
  30. document.querySelector("video-player").setAttribute("free", true) // set free to true
  31. 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
  32. }
  33. }, 100)