Skip to content

Disable or Enable JavaScript in Safari on iPhone & iPad

A blank page or a menu that refuses to open often comes down to JavaScript. Safari runs one global switch for it, and that switch lives in Settings, not in the browser itself.

When a site stays broken, blocking JavaScript is a quick test rather than a fix. Turn it back on when you are done. On iOS 18, Safari sits under Apps. On iOS 17 and earlier, it is a row on the main Settings screen.

In this guide, I have covered:

Where Safari hides the JavaScript switch

You open Settings, tap Safari, and there is no JavaScript switch anywhere. That is expected. Safari keeps it one level deeper, under Advanced, which is why plenty of people stop looking before they find it.

On iOS 18 and later, Safari no longer sits in the main Settings list. Apple moved it into a top-level Apps category. If Safari is missing from the Settings home screen, scroll down and tap Apps instead. On iOS 17 and earlier, Safari is still a top-level row, so you tap it directly and skip that step.

The toggle itself has not moved. Look under Safari → Advanced → JavaScript on any supported iOS release.

Block JavaScript in Safari on iPhone & iPad

Reach for this when a single site drains your battery, hides content behind scripts, or refuses to load at all. Treat the switch as a short test, not a permanent setting. Most modern pages need JavaScript to render anything.

  1. Open the Settings app on your iPhone or iPad.
  2. Tap Apps. On iOS 17 and earlier, scroll down and tap Safari directly instead.
  3. Scroll to the bottom of the Safari settings and tap Advanced.
  4. Toggle the JavaScript switch off so the pill turns gray. [img class=”aligncenter size-full wp-image-8659″ src=”https://browserhow.com/wp-content/uploads/sites/3/Block-JavaScript-execution-on-Safari-iOS-and-iPad.png” alt=”Block JavaScript execution on Safari iOS and iPad” width=”2048″ height=”1536″ /]

Reload any open tab and the change is obvious. Menus stop opening, comment threads disappear, infinite scroll stalls, checkout flows break. Pages render as flat text.

note icon

This switch is global. Safari on iPhone and iPad gives you no per-site JavaScript control, so every site you visit stays script-free until you switch it back on.

Turn JavaScript back on in Safari

Switch it back on as soon as you finish testing. Most sites will not work correctly without JavaScript, and Apple still lists the toggle as on by default in the iPhone user guide.

  1. Open the Settings app.
  2. Tap Apps on iOS 18 and newer, or scroll down and tap Safari on older releases.
  3. Tap Advanced under the Safari settings.
  4. Toggle the JavaScript switch on so the pill turns green. [img class=”aligncenter size-full wp-image-8646″ src=”https://browserhow.com/wp-content/uploads/sites/3/Enable-JavaScript-on-Safari-iPhone-or-iPad.png” alt=”Enable JavaScript on Safari iPhone or iPad” width=”2048″ height=”1536″ /]

Then open a fresh tab. A page that was already loaded keeps its old state, so close the tab and open it again to see the change.

Other Safari settings that pair with the JavaScript toggle

If you came here to save battery or to debug one broken page, the switches beside this one are probably next on your list. Safari keeps them all in the same place.

For a walkthrough of every switch Safari gives you on iPhone and iPad, see our guide to Privacy and Security settings in Safari.

The switch adjusted most often alongside JavaScript is cross-site tracking protection, on Safari’s Privacy & Security screen. Hide IP Address from Trackers sits right next to it.

Apple ships the same toggle in Safari on Mac, where the Develop menu can block scripts per site, something iOS never offers. There is a walkthrough in the FAQ below.

Missing JavaScript toggle? Check these three things

Every current iOS and iPadOS release shows a JavaScript switch under Safari → Advanced. If yours does not, one of these three is usually behind it.

  1. You are in the wrong app’s settings. Tap Apps (or Safari on iOS 17 and earlier) and check that the header reads Safari before you scroll for Advanced.
  2. Screen Time restrictions are hiding the Safari pane. Open Settings → Screen Time → Content & Privacy Restrictions → Allowed Apps and confirm Safari is allowed.
  3. A managed profile from work or school is locking Safari’s settings. Open Settings → General → VPN & Device Management, tap the profile, then either remove it or ask the IT admin to allow the Safari Advanced toggle.

Apple has not removed this switch at any iOS version, including the newest releases. When it disappears, a restriction or managed profile is almost always the reason.

Frequently Asked Questions

Does Safari on iPhone support per-site JavaScript blocking?

No. Safari on iOS and iPadOS gives you one global JavaScript toggle and no per-site override. Chrome, Firefox, and desktop browsers offer per-site controls. Safari does not.

Will turning off JavaScript make Safari faster?

Sometimes. Disabling JavaScript stops scripts from running, which can lower CPU use on script-heavy sites and stretch battery life. You lose interactivity in exchange, so keeping JavaScript off permanently is rarely worth it.

Does blocking JavaScript protect me from web trackers?

It helps, but it is not a full privacy fix. JavaScript powers most third-party trackers, so switching it off blocks some of them. For stronger protection, leave JavaScript on and enable cross-site tracking protection in Safari on iPhone instead, along with Hide IP Address from Trackers.

Why is the Safari section missing from my Settings app?

On iOS 18 and newer, Safari lives under the Apps category instead of the top level. Scroll down the Settings home screen until the Apps entry appears. On iOS 17 and earlier, Safari appears directly in the main list and you can skip that step.

Can I configure JavaScript the same way in Safari on Mac?

Yes. Safari on macOS has a similar JavaScript toggle, plus a Develop menu that can block scripts per site. See the walkthrough for configuring JavaScript in Safari on Mac for both options.

Please share the article if you find it helpful:

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases; of course at no extra cost to you (indeed, you may get special discounts).
Kushal Azza

Kushal Azza

Kushal Azza is a Google Certified Analytics & IT Professional, Digital Content Creator, and Go-To Digital Marketer. He has over a decade of experience solving tech problems, troubleshooting, and innovating digital solutions. Follow him on Twitter and LinkedIn.

Leave a thought or feedback

Please leave a descriptive comment or feedback with your real name. Our human moderator vets every comment, and it may take 24 to 48 hours to get published or rejected.
Your email address will not be published, and we will never spam your inbox. Required fields are marked *