How to Disable JavaScript in the Safari Web Browser

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

disable javascript in safari
Getty Images (Ernesto r. Ageitos #508932516)

JavaScript adds dynamic behavior to websites, which enhances them and provides a friendlier experience to the viewers. However, because JavaScript is a powerful — and many say flawed — programming language, it can also be used to write malware, which has made it unwelcome by many computer users. JavaScript is enabled by default in the Safari browser on Mac computers and Apple's iPhone and other mobile devices. If you don't want to run it for security reasons, you can turn it off in the Mac's System Preferences screen or the iPhone's Settings app.

How to Disable JavaScript in Safari on a Mac

On your Mac, open the Safari browser by clicking its icon in the dock. When it is open:

  1. Click on Safari in the menu bar located at the top of the screen.
  2. Select Preferences from the drop-down menu that appears to open the Mac's System Preferences screen. You can also use the keyboard shortcut Command + Comma to open the System Preferences screen.
  3. Click the Security tab in the System Preferences screen.
  4. Remove the check from the box in front of Enable JavaScript to disable the JavaScript.

Some websites may not function as expected while JavaScript is disabled. To re-enable it at a later time, repeat these steps and put a check in front of Enable JavaScript.

How to Disable JavaScript in Safari on an iPhone

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

  1. Tap 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.