How to Disable JavaScript in the Safari Web Browser

If you're concerned about security with JavaScript, disable it

What to Know

  • Open Safari, go to the Safari menu, and select Preferences > Security. Uncheck Enable JavaScript to disable the feature.
  • On an iPhone: Open the Settings app, then scroll down and tap Safari. At the bottom of the Safari settings screen, tap Advanced.
  • Then, tap the slider next to JavaScript to toggle it to the off position.

This article explains how to disable JavaScript in the Safari web browser for macOS and iOS operating systems if you don't want to run it for security reasons.

How to Disable JavaScript in Safari on a Mac

JavaScript adds dynamic behavior to websites, enhancing them and providing a friendlier experience to viewers. However, because JavaScript is a powerful programming language, people can also use it to write malware, making it unwelcome by many computer users.

In Safari on Mac, you can enable and disable JavaScript in the Preferences menu. Here's how to do it:

  1. Open Safari.

  2. Open the Safari menu and select Preferences.

    The keyboard shortcut for Preferences is Command+, (comma).

    Safari on a Mac with the Preferences menu item highlighted
  3. Go to the Security tab.

    Safari Preferences with the Security tab highlighted
  4. Clear the Enable JavaScript check box to disable the feature.

    Security preferences in Safari with the Enable JavaScript box highlighted

Some websites may not function as expected while JavaScript is disabled.

How to Disable JavaScript in Safari on an iPhone

On your iPhone or another iOS device, disable JavaScript in the Settings app:

  1. Open the Settings app.

  2. Scroll down to Safari and tap it.

  3. At the bottom of the Safari settings screen, tap Advanced.

  4. Tap the slider next to JavaScript to toggle it to the off position.

    iOS settings with JavaScript toggle highlighted
Was this page helpful?