[Flightradar24] Combo FlightRadar24 Script

Removes the Ad Container on the bottom right of the FlightRadar24 page and refreshes the page every 30 minutes. Essentially removing the 30 minute timeout.

当前为 2024-07-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name [Flightradar24] Combo FlightRadar24 Script
  3. // @namespace HKR
  4. // @match https://www.flightradar24.com/*
  5. // @grant none
  6. // @version 1.4
  7. // @license MIT
  8. // @author Bruna
  9. // @description Removes the Ad Container on the bottom right of the FlightRadar24 page and refreshes the page every 30 minutes. Essentially removing the 30 minute timeout.
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. // Function to remove the ad once it appears
  14. function removeAdWhenReady() {
  15. const ad = document.getElementById("primisAdContainer");
  16. if (ad) {
  17. ad.remove(); // Remove the ad if found
  18. observer.disconnect(); // Disconnect the observer once done
  19. }
  20. }
  21.  
  22. // Callback function for the observer
  23. function observeDOM() {
  24. const targetNode = document.body; // Assuming the ad container might be within the body
  25.  
  26. // Options for the observer (we want to observe child additions)
  27. const config = { childList: true };
  28.  
  29. // Create an observer instance linked to the callback function
  30. const observer = new MutationObserver(removeAdWhenReady);
  31.  
  32. // Start observing the target node for configured mutations
  33. observer.observe(targetNode, config);
  34.  
  35. // Immediately check for the ad in case it's already there
  36. removeAdWhenReady();
  37. }
  38.  
  39. // Start observing the DOM
  40. observeDOM();
  41.  
  42.  
  43. const tillThirty = setTimeout(thirty, 1798000);
  44.  
  45. function thirty() {
  46. console.log("30 Minute time reached. Refreshing...")
  47. location.reload();
  48. }