Convert to FiveM button for gta5-mods.com

A small userscript that adds a Convert to FiveM button to vehicle mod pages on gta5-mods.com. One click opens the converter with that mod's link filled in, so you do not have to copy and paste it.

Install the button

Version 1.0.0. Needs a userscript manager (steps below). Free, MIT licensed, 143 lines you can read first.

Independent tool. Not affiliated with or endorsed by gta5-mods.com, Rockstar Games, Take-Two Interactive or Cfx.re.

What the button does

Converting a car normally starts with copying the address of its gta5-mods.com page and pasting it into the converter. With the script installed, every vehicle mod page has a Convert to FiveM button under its Download button. It opens the converter in a new tab with the link already in the input.

Nothing is converted until you press Convert on this site. The converter gives 3 free conversions without an account; the pricing page has what comes after. The button is for vehicle mods only, because those are the only mods the converter takes.

Install

A userscript runs inside a browser extension called a userscript manager. Install one of the two below, then press Install the button. Use the manager's own site for the list of browsers it supports.

With Tampermonkey

  1. 1Install Tampermonkey from tampermonkey.net. Its site offers it for Chrome, Microsoft Edge, Safari, Opera Next and Firefox.
  2. 2In a Chrome-based browser, allow it to run scripts. Tampermonkey's FAQ says version 5.3 and later needs one of two switches: from Chrome 138, right-click the Tampermonkey icon, choose Manage Extension and turn on Allow User Scripts; otherwise open chrome://extensions or edge://extensions and turn on Developer mode (FAQ Q209).
  3. 3Press Install the button. Tampermonkey opens a page with the script's source; confirm with its Install button.
  4. 4Open any vehicle mod on gta5-mods.com. The button is under Download.

With Violentmonkey

  1. 1Install Violentmonkey from violentmonkey.github.io. That page links its Chrome Web Store, Firefox Add-ons and Microsoft Edge Add-ons listings.
  2. 2In Chrome, allow it to run scripts. Chrome's extension documentation says an extension that runs user scripts needs the Allow User Scripts toggle on its details page from Chrome 138, and Developer mode on chrome://extensions before that (Chrome docs).
  3. 3Press Install the button. Violentmonkey opens its installer page for the script; confirm the installation there.
  4. 4Open any vehicle mod on gta5-mods.com. The button is under Download.

If pressing Install only shows the file as text, the userscript manager is not installed or is switched off. Nothing has been installed in that case.

What it does and does not do

It does

  • Runs only on gta5-mods.com addresses under /vehicles/, including the language versions such as /de/vehicles/.
  • Reads two things: the address of the page, and whether the page has the mod's download button or file container.
  • Adds one link, Convert to FiveM, under the Download button. If that button is not where the script expects it, the link appears as a small fixed button in the bottom right corner.
  • When you click it, opens this site's converter in a new tab with the mod page address and utm_source=userscript in the link. That tells this site which mod you want and that you came from the button.

It does not

  • No network requests of its own: no fetch, XMLHttpRequest, beacons, images or iframes.
  • No cookies, no localStorage, no reading of forms, accounts or page text.
  • No remote code and no external files. Everything it runs is in the one file shown below.
  • No userscript-manager permissions: the header says @grant none.
  • It does not start a conversion, click anything or download anything, and it changes nothing else on the page.
  • The link is opened with rel="noopener noreferrer", so the new tab gets no handle on the gta5-mods.com tab and no referrer.

Once you are on this site, the site's own privacy policy applies, as for any other visit. The script's header also names this site's copy of the file as its update address, so a userscript manager that checks for updates requests that file from this site.

The full source

This is the file the Install button serves, all 143 lines of it. Read it before you install it; the comment at the top says what each part is for.

gta5-mods-convert-button.user.jsInstall
// ==UserScript==
// @name         GTA5 Mods: Convert to FiveM button
// @namespace    https://www.gta5modsconvertor.com/
// @version      1.0.0
// @description  Adds a "Convert to FiveM" button to vehicle mod pages on gta5-mods.com. It opens gta5modsconvertor.com with the mod link filled in. Independent tool, not affiliated with gta5-mods.com.
// @author       GTA5 Mods Convertor
// @match        https://www.gta5-mods.com/vehicles/*
// @match        https://www.gta5-mods.com/*/vehicles/*
// @grant        none
// @run-at       document-idle
// @noframes
// @homepageURL  https://www.gta5modsconvertor.com/tools/convert-button
// @downloadURL  https://www.gta5modsconvertor.com/gta5-mods-convert-button.user.js
// @updateURL    https://www.gta5modsconvertor.com/gta5-mods-convert-button.user.js
// @license      MIT
// ==/UserScript==

/*
 * WHAT THIS SCRIPT DOES (the whole of it, so you can audit it in a minute)
 *
 * 1. Runs only on gta5-mods.com addresses under /vehicles/ (and the language
 *    versions such as /de/vehicles/).
 * 2. Checks that the page is a single vehicle mod page: the address has a mod
 *    name after /vehicles/, and the page has the mod's download button or its
 *    file container. On listing, tag, sort and numbered pages it does nothing.
 * 3. Adds ONE link, "Convert to FiveM", directly under the page's Download
 *    button. If that button is not where it is expected, the link is shown as
 *    a small fixed button in the bottom right corner instead.
 * 4. The link opens, in a new tab and only when you click it:
 *      https://www.gta5modsconvertor.com/?url=<address of this mod page>&utm_source=userscript
 *    The converter fills the mod link into its input. Nothing is converted
 *    until you press Convert there.
 *
 * WHAT IT DOES NOT DO
 *
 * - No network requests (no fetch, XMLHttpRequest, beacons, images or iframes).
 * - No cookies, no localStorage, no reading of forms, accounts or page text.
 *   The only things it reads are the page address and whether the download
 *   button exists.
 * - No remote code and no external files: everything it runs is in this file.
 * - No userscript-manager permissions (@grant none).
 * - It changes nothing else on the page and never clicks or downloads anything.
 *
 * Independent tool. Not affiliated with or endorsed by gta5-mods.com,
 * Rockstar Games, Take-Two Interactive or Cfx.re.
 */

(function () {
  "use strict";

  var CONVERTER = "https://www.gta5modsconvertor.com/";
  var BUTTON_ID = "g5mc-convert-button";
  var LABEL = "Convert to FiveM";
  var TITLE =
    "Opens gta5modsconvertor.com with this mod's link filled in. " +
    "Independent tool, not part of gta5-mods.com.";

  // Addresses under /vehicles/ that are lists of mods, not a mod.
  var LISTING_NAMES = [
    "tags", "day", "week", "month", "most-liked", "most-downloaded",
    "highest-rated", "latest-uploads", "latest-versions", "featured"
  ];

  /**
   * The mod's name from the page address, or null when the address is not a
   * single vehicle mod. Accepts /vehicles/<name> and /<xx>/vehicles/<name>
   * (two-letter language code), with anything after the name ignored.
   */
  function modSlug(pathname) {
    var parts = pathname.split("/").filter(Boolean);
    if (parts.length && /^[a-z]{2}$/i.test(parts[0])) parts.shift();
    if (parts.length < 2 || parts[0].toLowerCase() !== "vehicles") return null;
    var slug = parts[1];
    if (/^\d+$/.test(slug)) return null; // page number of the listing
    if (LISTING_NAMES.indexOf(slug.toLowerCase()) !== -1) return null;
    if (!/^[A-Za-z0-9%._~-]+$/.test(slug)) return null; // unexpected characters: leave the page alone
    return slug;
  }

  /** The link element. All styling is inline; no stylesheet or asset is added. */
  function buildLink(href, fixed) {
    var a = document.createElement("a");
    a.id = BUTTON_ID;
    a.href = href;
    a.target = "_blank";
    a.rel = "noopener noreferrer";
    a.title = TITLE;
    a.textContent = LABEL;
    var css = [
      "box-sizing:border-box",
      "text-align:center",
      "padding:8px 14px",
      "font:600 14px/1.4 system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif",
      "color:#fff",
      "background:#c2410c",
      "border:1px solid #9a3412",
      "border-radius:4px",
      "text-decoration:none",
      "cursor:pointer"
    ];
    if (fixed) {
      css.push(
        "position:fixed", "right:12px", "bottom:12px", "z-index:2147483000",
        "display:inline-block", "box-shadow:0 2px 8px rgba(0,0,0,.35)"
      );
    } else {
      css.push("display:block", "margin:0 0 10px 0");
    }
    a.setAttribute("style", css.join(";"));
    return a;
  }

  function run() {
    // Never insert twice.
    if (document.getElementById(BUTTON_ID)) return;

    var slug = modSlug(window.location.pathname);
    if (!slug) return;

    // A mod page has a download button and/or a #file container. A listing has neither.
    var download = document.querySelector("#file-container a.btn-download, a.btn-download");
    var fileBox = document.querySelector("#file[data-user-file-id]");
    if (!download && !fileBox) return;

    // The form the converter accepts: English address, no language prefix, no extras.
    var modUrl = "https://www.gta5-mods.com/vehicles/" + slug;
    var href = CONVERTER + "?url=" + encodeURIComponent(modUrl) + "&utm_source=userscript";

    if (download && download.parentNode) {
      // Directly under the Download button, as its next sibling.
      download.parentNode.insertBefore(buildLink(href, false), download.nextSibling);
    } else if (document.body) {
      // Layout differs from what this script knows: small fixed button instead.
      document.body.appendChild(buildLink(href, true));
    }
  }

  try {
    run();
  } catch (e) {
    // If the page is not what this script expects, do nothing at all.
  }
})();

How to remove it

Click the userscript manager's icon in the browser toolbar, open its dashboard (the list of installed scripts), find GTA5 Mods: Convert to FiveM button and delete it. To pause it, switch it off in the same list.

The script stores nothing in your browser, so there is nothing else to clean up. Removing the userscript manager itself removes every script in it.

Frequently asked questions

Is the button free?

The script is free and MIT licensed. The converter it opens gives 3 free conversions without an account; after that it is a paid service, and the pricing page has the plans.

Does clicking the button start a conversion?

No. It opens the converter with the mod link filled in. Nothing is converted, and no free conversion is used, until you press Convert there.

Which pages get the button?

Single vehicle mod pages on gta5-mods.com, in any of the site's languages. Listing, tag, sort and numbered pages do not get it, and neither do scripts, maps, weapons, player or paint job mods, because the converter only takes vehicle mods.

I installed it and see no button. What now?

Reload the mod page and check that the script is switched on in your userscript manager. In a Chrome-based browser, also check that the manager is allowed to run user scripts (the Allow User Scripts toggle or Developer mode, described in the install steps). If gta5-mods.com changes its page layout the script may need an update.

Does the script update itself?

Its header names this site's copy of the file as the update address, so a userscript manager that checks for updates will fetch that file and nothing else. You can switch update checks off for the script in the manager. The source on this page is the file that is served.

Is this from gta5-mods.com or Rockstar?

No. It is an independent tool from GTA5 Mods Convertor. It is not affiliated with or endorsed by gta5-mods.com, Rockstar Games, Take-Two Interactive or Cfx.re.

More answers about conversions, limits and plans are in the general FAQ. The other tools are on the tools page.

No userscript manager? Paste the link instead

The button is a shortcut. Copy the address of a gta5-mods.com vehicle page, paste it into the converter and download a FiveM resource.

  • 3 conversions free, no account needed
  • 2 more free if you leave an email
  • After that: $15 once for unlimited conversions and the Pro tools. No subscription, 14-day refund policy