sodcalculator

10 Tech How-To

Disable JavaScript JIT Compilation in a Browser

Guide 10-59076 · Updated · Step by step

Disabling JavaScript JIT (Just-In-Time) compilation forces the browser to interpret JavaScript instead of compiling it to machine code at runtime. This can help with debugging (e.g., to reproduce timing bugs), improve security in some environments, or reduce memory usage. The exact steps vary by browser; here’s how to do it in the most common ones.

What You’ll Need

  • Administrator or owner access to the browser installation (for some methods).
  • For Chrome/Edge: the browser must be launched from a command line or shortcut.
  • For Firefox: a user.js file or about:config access.
  • For Safari: a Mac with the Develop menu enabled.

Step-by-Step

Google Chrome / Microsoft Edge (Chromium)

  1. Close the browser completely (all windows and background processes).
  2. Locate your browser’s executable file. On Windows, it’s usually in C:\Program Files\Google\Chrome\Application\chrome.exe or C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe. On macOS, it’s inside the .app bundle.
  3. Create a shortcut to the executable (or edit an existing one). Right-click the shortcut → Properties.
  4. In the “Target” field, add the flag --js-flags="--jitless" after the existing path. For example:
    "C:\Program Files\Google\Chrome\Application\chrome.exe" --js-flags="--jitless"
  5. Click OK and launch the browser using that shortcut. To verify, open DevTools (F12) and type %GetOptimizationStatus() in the console. If JIT is off, it will return a value indicating “not optimized” or you may see a warning.

Mozilla Firefox

  1. Open Firefox and type about:config in the address bar. Press Enter.
  2. Click “Accept the Risk and Continue” if prompted.
  3. In the search box, type javascript.options.jit.content.
  4. Double-click the preference to set it to false. This disables JIT for web content.
  5. Optionally, also set javascript.options.jit.trustedprincipals to false to disable JIT for browser internals (this can break some features).
  6. Restart Firefox. To verify, open the Web Console (Ctrl+Shift+K) and check the “Performance” tab – JIT optimizations should not appear.

Safari (macOS)

  1. Enable the Develop menu: Safari → Settings → Advanced → check “Show features for web developers”.
  2. Go to Develop → Experimental Features.
  3. Find and uncheck “JavaScript JIT” (or “Enable JIT” – the exact name varies by version).
  4. Refresh the page. The setting applies immediately.
  5. To verify, go to Develop → Show JavaScript Console and look for a message like “JIT disabled” or check that performance is slower.

Mobile Browsers (Android/iOS)

  1. Most mobile browsers do not expose a JIT toggle. The easiest workaround is to use a browser that supports extensions (like Firefox for Android) and install a script that forces the browser to run without JIT (e.g., by using a custom user agent or a “disable JIT” extension).
  2. Alternatively, use the desktop version of the site in a browser that allows remote debugging and apply the same flags via ADB (Android) or Safari Web Inspector (iOS).

Common Mistakes

  • Not closing the browser fully: If Chrome is still running in the background, the flag won’t apply. Use Task Manager (Ctrl+Shift+Esc) to end all processes.
  • Using the wrong flag syntax: The flag is --js-flags="--jitless" – note the double quotes and the inner double dash. Missing either will cause the flag to be ignored.
  • Editing the wrong shortcut: If you launch the browser from the Start menu or Dock, the shortcut you edited may not be the one used. Always launch from the edited shortcut.
  • In Firefox, changing the wrong preference: There are several JIT-related prefs. Make sure you change javascript.options.jit.content, not just javascript.options.jit (which is a master switch that may be deprecated).
  • Expecting a visible indicator: Disabling JIT doesn’t show a banner; you need to verify via DevTools or performance testing.

Tips

  • Use a separate browser profile or a dedicated shortcut for testing, so you don’t have to re-enable JIT later.
  • If you’re debugging a specific site, use the “–user-data-dir” flag to create a temporary profile with JIT disabled.
  • For Firefox, you can also set the preference via user.js file in your profile folder for a persistent change.
  • Remember that disabling JIT will make JavaScript execution significantly slower – this is expected and useful for testing performance bottlenecks.
  • In Chrome, you can also use the command line flag --js-flags="--no-opt" to disable only the optimizing compiler, which is less drastic than --jitless.

Troubleshooting

  • Flag not working: Ensure you’re using the correct executable path and that no other instance of the browser is running. Also check that the shortcut is not being overridden by a policy (e.g., in corporate environments).
  • Firefox setting resets: Some Firefox updates may reset the preference. Re-apply it after updates, or use a user.js file to enforce it.
  • Site still runs fast: Some sites use WebAssembly, which is not affected by JIT disabling. The slowdown may not be noticeable for simple scripts.
  • Browser crashes: Disabling JIT can expose bugs in the browser or website. Try disabling hardware acceleration as well, or use a different browser.
  • Can’t find the Safari option: The experimental feature may be under a different name in older Safari versions. Look for “JIT” or “JavaScript” in the list. If not present, update Safari.

Frequently Asked Questions

Will disabling JIT make my browser safer?

It can reduce the attack surface for certain types of exploits, but it also disables performance optimizations. For everyday browsing, the security benefit is negligible; it’s mainly used in high-security environments or for debugging.

Does disabling JIT affect all websites?

Yes, it affects all JavaScript execution in the browser. However, some sites may use WebAssembly, which is not JIT-compiled in the same way, so those may still run at full speed.

Can I disable JIT only for a specific site?

Not directly. You would need to use browser developer tools to emulate the setting per site, but that’s not a standard feature. A workaround is to use a separate browser profile for that site.

How do I know if JIT is actually disabled?

In Chrome, open DevTools and run %GetOptimizationStatus() – if it returns 0 or 1, JIT is off. In Firefox, check the Web Console for a message like “JIT disabled by pref”. In Safari, the Develop menu may show a small indicator.

Will disabling JIT break websites?

Most sites will still work, but some complex applications (like games or video editors) may become very slow or unresponsive. If a site crashes, re-enable JIT for that site.

Is there a way to disable JIT in Internet Explorer?

Internet Explorer is no longer supported by Microsoft. If you must use it, you can try adding the site to the Compatibility View list, but there is no official JIT toggle.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →