general / allgemein

Airmate Plates

Wenn ich unkompliziert Charts und Metar sowie Zusatzszenerien für einen Flughafen möchte, gehe ich auf Airmate und gebe über die Adresszeile den ICAO Code des Flughafens mit. Hier am Beispiel von Port Moresby (AYPY)

https://www.airmate.aero/php//pdf_viewer/plates.php?code=AYPY

Ist die Seite geöffnet, öffne ich mit [F12] die Entwickler-Tools und füge den u. g. Javascript Code in die Console ein und führe es aus.

// ==UserScript==
// @name         airmate Charts
// @namespace    http://tampermonkey.net/
// @version      2025-09-09
// @description  try to take over the world!
// @author       You
// @match        https://www.airmate.aero/php//pdf_viewer/plates.php?code=*
// @match        https://www.airmate.aero/php/pdf_viewer/plates.php?code=*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

(function () {
  "use strict";
  // Open the URL https://www.airmate.aero/php//pdf_viewer/plates.php?code=AYPY with the desired ICAO Code and run this script in console...

  function getUrlParameter(sParam) {
    let sPageURL = window.location.search.substring(1);
    let sURLVariables = sPageURL.split("&");
    let sParameterName, i;

    for (i = 0; i < sURLVariables.length; i++) {
      sParameterName = sURLVariables[i].split("=");

      if (sParameterName[0] === sParam) {
        // Return the decoded value, or true if the parameter exists without a value
        return sParameterName[1] === undefined
          ? true
          : decodeURIComponent(sParameterName[1].replace(/\+/g, " "));
      }
    }
    return false; // Parameter not found
  }

  let newHtml = `<style>summary::before{content:url('data:image/svg+xml,<%3Fxml version="1.0" encoding="UTF-8" standalone="no"%3F><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --><svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" version="1.1" id="svg1" sodipodi:docname="airport-icon.svg" inkscape:version="1.4.2 (f4327f4, 2025-05-13)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"><defs id="defs1" /><sodipodi:namedview id="namedview1" pagecolor="%23ffffff" bordercolor="%23000000" borderopacity="0.25" inkscape:showpageshadow="2" inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="%23d1d1d1" inkscape:zoom="0.3990625" inkscape:cx="-299.45184" inkscape:cy="560.06265" inkscape:window-width="2496" inkscape:window-height="1558" inkscape:window-x="-11" inkscape:window-y="-11" inkscape:window-maximized="1" inkscape:current-layer="svg1" /><rect style="fill:%23000000;fill-opacity:1;stroke:%23000000;stroke-width:0.716085;stroke-dasharray:none;stroke-opacity:1" id="rect2" width="16.024603" height="6.1639943" x="1.4185445" y="12.252053" transform="matrix(0.96802292,-0.25086177,0.25396657,0.967213,0,0)" /><rect style="fill:%23000000;fill-opacity:1;stroke:%23000000;stroke-width:1.2;stroke-dasharray:none;stroke-opacity:1" id="rect1-8" width="2.3362117" height="18.708752" x="12.517698" y="-17.348562" ry="0" transform="rotate(71.361188)" /><rect style="fill:%23000000;fill-opacity:1;stroke:%23000000;stroke-width:1.2;stroke-dasharray:none;stroke-opacity:1" id="rect1" width="2.3362117" height="18.708752" x="17.447639" y="-16.062576" ry="0" transform="rotate(71.361188)" /><rect style="fill:%23ffffff;fill-opacity:1;stroke:%23000000;stroke-width:1.43302;stroke-dasharray:none;stroke-opacity:1" id="rect1-5" width="2.8254335" height="15.595905" x="-17.944742" y="-19.399607" ry="0" transform="matrix(-0.99999805,0.00197244,-0.00415167,-0.99999138,0,0)" /><rect style="fill:%23ffffff;fill-opacity:1;stroke:%23000000;stroke-width:0;stroke-dasharray:none;stroke-opacity:1" id="rect1-8-1" width="1.2" height="18" x="13.08135" y="-16.84411" ry="0" transform="rotate(71.361188)" /><rect style="fill:%23ffffff;fill-opacity:1;stroke:%23000000;stroke-width:0;stroke-dasharray:none;stroke-opacity:1" id="rect1-8-1-7" width="1.2" height="18" x="17.950041" y="-15.66899" ry="0" transform="rotate(71.361188)" /></svg>');display:inline-block;margin-right:0.25em;transition:transform 0.3s ease;transform:rotate(-180deg)}summary{appearance:none;background:#16a34a;border-radius:0.25em;color:white;cursor:pointer;display:inline-block;padding:0 1em;&:hover{background-color:lighten(#16a34a, 2%)}}.details-modal{background:#ffffff;border-radius:0.5em;box-shadow:0 10px 20px rgba(0,0,0, 0.2);width:100%;left:50%;max-width:1000px;overflow:auto;padding:1em;pointer-events:auto;position:fixe;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);max-width:1000px;text-align:left;max-height:90vh;display:flex;flex-direction:column;.details-modal-title{color:#111827;padding:1.5em 2em;pointer-events:all;position:relative;width:calc(100% - 4.5em);h1{font-size:1.25rem;font-weight:600;line-height:normal}}.details-modal-content{border-top:1px solid #e0e0e0;padding:2em;pointer-events:all;overflow:auto}}.details-modal-overlay{transition:opacity 0.2s ease-out;pointer-events:none;background:rgba(0,0,0, 0.7);position:fixed;opacity:0;bottom:0;right:0;left:0;top:0;details[open] &{pointer-events:all;opacity:0.8}}details{summary{list-style:none;&:focus{outline:none}&::-webkit-details-marker{display:none}}}.charts{column-count:auto;column-width:300px}.details-modal .header{display:flex;flex-flow:row wrap;justify-content: flex-start;border-bottom: 1px solid silver;padding-bottom: 1em;}.details-modal .header div{width: 300px;}</style>`;
  newHtml += "<details id='" + getUrlParameter("code") + "' open>";
  newHtml +=
    "<summary>" +
    getUrlParameter("code") +
    "<div class='details-modal-overlay'></div></summary>";
  newHtml +=
    '  <div class="details-modal"><div class="details-modal-title"><h1>' +
    getUrlParameter("code") +
    '</h1></div><div class="header"><div id="sceneries"><h2><svg xmlns="http://www.w3.org/2000/svg" class="logo-white" id="svg40" width="24" version="1.1" viewBox="0 0 360 300"> <defs id="defs4"> <style id="style2"> .cls-3{fill:#9ad3d2}.cls-5{fill:#14162b} </style> </defs> <g id="Layer_2" data-name="Layer 2" transform="translate(-162.71577 -73.822698)"> <g id="SVG_Logo" data-name="SVG Logo"> <g id="Layer_2-2" data-name="Layer 2" transform="matrix(.61264 0 0 .61264 162.71577 73.824731)"> <g id="Layer_1-2" data-name="Layer 1-2"> <path id="path859" d="M500.69 3.19c-22.38 18.66-44.91 37.15-67.13 56-42.14 35.62-84 71.79-126 107.46-41.79 35.21-83.85 70-125.47 105.25-4.47 3.78-9.18 9.13-10.44 14.52-7.65 32.88-14.11 66.15-21.43 99.17-2.07 7.08-4.78 23.13-7.78 29.86V258.83c0-11.45 2.62-20.56 11.45-26Q296.26 132.22 438.36 31.11c12.42-9.38 21.64-18.22 33.75-25.84 10.05-6.27 25.02-6.93 28.58-2.08Z" style="fill:#edf3fb"></path> <path id="path861" d="M500.69 3.19s9.05 8.74-.5 38.37c-11.94 39-102.88 325.62-114.85 364.64q-7.71 25.26-28.89 9.7c-43.29-31.9-88.55-65.12-131.77-97.14a102.07 102.07 0 0 1 13.9-19.45c17.34-18.61 35.95-36.06 53.43-54.53 19.75-20.85 38.41-42.43 58.17-63.28 17.4-18.36 35.62-36 53.29-54.06 37.74-39.87 26.3-27.89 37.74-39.87 15.18-16.22 29.62-33.1 44.66-49.46 9.39-10.37-14.15-10.57 14.82-34.92z" style="fill:#62a8c4"></path> <path id="path863" d="M480.26 1.69c-9 2.88 0 0-42 29.5q-142 100.92-284.37 201.59c-8.83 5.47-11.2 13.9-11.45 26C98 241.77 53.43 225 9.26 207.32 4.79 205.54 0 200.09 0 193.79c0-6.14 4.91-11.26 10.38-14.09 37.87-15.2 76.15-29.34 114.29-43.84L413.48 25.49c15.89-6.06 31.75-12.22 47.7-18.08 3.55-.98 15.63-5.36 19.08-5.72z" class="cls-3"></path> <path id="path865" d="M486.06 38C471 54.4 456.58 71.2 441.4 87.42l-37.73 39.87c-17.7 18.08-35.9 35.62-53.3 54.06-19.75 20.85-38.55 42.58-58.31 63.43-17.48 18.47-36.08 35.92-53.43 54.53A100.55 100.55 0 0 0 225 318.8c-4.58 7.75-7.83 16.51-12 24.52-13.46 26.27-26.58 52.69-39.87 79.05-6 11.92-11.13 15.15-21.4 12.25-9.7-2.74-9.54-11.13-9.37-19.19 7.78-29.86 0 0 7.62-29.92 7.31-32.88 13.7-66.23 21.42-99.16 1.26-5.48 6-10.74 10.44-14.52 41.79-35.21 83.85-70 125.5-105.2 42.2-35.62 84-71.73 126.18-107.46 22.22-18.83 44.75-37.32 67.13-56 8.77 9.32-5.29 24.45-14.59 34.83z" style="fill:#d9e4f6"></path> <path id="path867" d="m474 3.27-2.11 2.05z" class="cls-3"></path> </g> </g>  </g> </g> </svg>';
  newHtml += "Sceneries</h2>";
  newHtml +=
    "<a href='https://de.flightsim.to/discover/" +
    getUrlParameter("code") +
    "' target='plates+more'>at flightsim.to</a></div>";
  newHtml +=
    "<div class='metar-taf'><h2><img src='https://metar-taf.com/images/windsock.svg' width='24px'>METAR / TAF</h2>";
  newHtml +=
    "<a href='https://metar-taf.com/metar/" +
    getUrlParameter("code") +
    "' target='plates+more'>für " +
    getUrlParameter("code") +
    "</a></div></div>";
  newHtml += '<h2>Charts</h2><div class="charts">';
  // Collect groups and plates
  let groups = Array.from(
    document.body.querySelectorAll("#tabs-plates>div")
  ).map((group) => {
    const chartGroup = group.getAttribute("id").replace("tab-", "");
    let plates = Array.from(group.querySelectorAll("option")).map((plate) => ({
      value: plate.value,
      text: plate.innerText ? plate.innerText : chartGroup,
    }));
    // Strict alphanumeric sort for plates
    plates.sort((a, b) =>
      a.text.localeCompare(b.text, undefined, {
        numeric: true,
        sensitivity: "base",
      })
    );
    return { chartGroup, plates };
  });

  // Strict alphanumeric sort for groups
  groups.sort((a, b) =>
    a.chartGroup.localeCompare(b.chartGroup, undefined, {
      numeric: true,
      sensitivity: "base",
    })
  );

  // Build HTML
  groups.forEach(({ chartGroup, plates }) => {
    newHtml += "<div class='chartGroup'><h3>" + chartGroup + "</h3>";
    plates.forEach((plate) => {
      newHtml +=
        "<p><a href='" +
        plate.value +
        "' target='plates+more'>" +
        plate.text +
        "</a></p>";
    });
    newHtml += "</div>";
  });

  newHtml += "</div></div></details>";
  console.log(newHtml);

  document.documentElement.innerHTML = newHtml;
})();

Daraufhin erhalte ich einen Link auf die Suche in Flightsim.to, die Charts des Flughafens und am Ende einen Link auf die METAR/TAF des Flughafens.