Skip to content

Instantly share code, notes, and snippets.

@jsilva74
Created December 2, 2023 09:55
Show Gist options
  • Select an option

  • Save jsilva74/84c5dbe41cfddbe7a1e3882e4cb79477 to your computer and use it in GitHub Desktop.

Select an option

Save jsilva74/84c5dbe41cfddbe7a1e3882e4cb79477 to your computer and use it in GitHub Desktop.

Revisions

  1. jsilva74 created this gist Dec 2, 2023.
    23 changes: 23 additions & 0 deletions link2icao.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    // ==UserScript==
    // @name Link in ICAO
    // @namespace http://tampermonkey.net/
    // @version 1.0.0
    // @description try to take over the world!
    // @author You
    // @match https://server.fseconomy.net/aircraftlog.jsp*
    // @icon https://www.google.com/s2/favicons?sz=64&domain=fseconomy.net
    // @grant none
    // ==/UserScript==
    /* global $ */

    (function() {
    'use strict';

    $('document').ready(function() {
    const table = $('table:eq(0)')
    const home = $('table:eq(0) tbody tr td:eq(3)').text()
    const location = $('table:eq(0) tbody tr td:eq(4)').text()
    $('table:eq(0) tbody tr td:eq(3)').html(`<a href="https://server.fseconomy.net/airport.jsp?icao=${home}" target='_blank'>${home}</a>`)
    $('table:eq(0) tbody tr td:eq(4)').html(`<a href="https://server.fseconomy.net/airport.jsp?icao=${location}" target='_blank'>${location}</a>`)
    })
    })();