Function tryGetExtensionFromUrl

  • Extracts a file extension (upper-cased, no dot) from a URL, checking in order: the ?filetype= query, the pathname, then the URL fragment. The fragment is the only reliable carrier for blob: URLs (drag & drop) and filename-eliding URLs — e.g. blob:…/uuid#model.ply.

    Parameters

    Returns null | string

    the extension, or null if none of the carriers has one.