Skip to content
Commit c1e831ab authored by Luca's avatar Luca
Browse files

The compiler generate a variable "Elm" in the global space.

This variable usually has the methods "Elm.Main.init" (for Elm version 0.19) or "Elm.Main.embed" (for Elm verison 0.18 or erlier).

It can also be initialized with other methods, such as "Elm.SpecificMethod.init" but usually "Main" is the default.

"Elm" only as detection method can create false positive, being very short. So I gave it a confidence of 50%.

This detection misses all cases where Elm is wrapped in a "Self-Executing Anonymous Function". This is probably a common case, as it happens, for example, using Webpack, Parcel or other binders.

In this case I don't know any way to detect Elm, unless analysing the code itself.

I also added the detection of an Elm library, elm-ui, that is very popular and leave a signature in the rendered html. I used the regular expression

    "<style>[\\s\\S]*\\.explain > \\.s[\\s\\S]*\\.explain > \\.ctr > \\.s"

I had to run the regex on multiple lines because the text is not on the same line of the opening <style> element. I think the metching string is quite unique and should not create false positives.

* Elm has 5.9k starts in Github https://github.com/elm/compiler

These are few examples of sites build in Elm

https://support.xapo.com/
https://unli.xyz/flights/
https://elmjapan.org/
https://odyssey.neophilus.net/
https://www.verwonderpaspoort.nl/verwonderwereld
https://cie.nl/?lang=en
http://weightybirds.com/
http://ivanschuetz.com/
https://justinmimbs.github.io/asteroids/
https://elm-lang.org/
https://login.account.rakuten.com/sso/authorize?client_id=rakuten_tw01&redirect_uri=https%3A%2F%2Fwww.rakuten.com.tw%2Fmember%2Fdelegate&response_type=code&scope=openid+profile+email#/sign_in
http://builtwithelm.co/
https://68kheart.work/efa/projects/
https://game.faithloewe.com/
https://fakeorbabe.com/
http://fap.work/
https://app.featureaudit.com/
https://www.reju.jp/
http://concourse.particle.io/

https://github.com/AliasIO/wappalyzer/pull/1782
https://github.com/AliasIO/wappalyzer/pull/1442
https://github.com/AliasIO/wappalyzer/pull/778

    "Elm": {
      "cats": [
        12
      ],
      "icon": "elm.svg",
      "js": {
        "Elm.Main.init": "\\;version:0.19",
        "Elm.Main.embed": "\\;version:0.18",
        "Elm": "\\;confidence:50",
      },
      "website": "https://elm-lang.org/"
    },
    "elm-ui": {
      "cats": [
        66
      ],
      "icon": "elm.svg",
      "implies": "Elm",
      "html": "<style>[\\s\\S]*\\.explain > \\.s[\\s\\S]*\\.explain > \\.ctr > \\.s"
      "website": "https://github.com/mdgriffith/elm-ui"
    },
parent a805ebce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment