How to Enable JavaScript on Safari: iPhone, iPad, and Mac

JavaScript powers nearly every interactive element on the modern web — dropdown menus, login forms, video players, maps, shopping carts. Without it, many websites either break visually or stop functioning entirely. Safari supports JavaScript across all Apple devices, but the setting isn't always enabled by default depending on device age, iOS profile restrictions, or previous manual changes. Here's exactly where to find it and what to know before you toggle it.

Why JavaScript Gets Disabled in the First Place

Most users never touch this setting — and that's fine. But JavaScript does get switched off in a few common scenarios:

  • Parental controls or MDM profiles (Mobile Device Management) on school or work devices may disable it intentionally
  • Older how-to guides recommended disabling JavaScript for privacy or speed on low-powered devices
  • Accidental changes during settings exploration, particularly on iOS where menus are deeply nested
  • Content blockers sometimes interact with JavaScript settings in unexpected ways

Understanding why it was off in the first place matters, because re-enabling it on a managed device may not stick — an administrator profile can override your change.

How to Enable JavaScript on Safari for iPhone and iPad 📱

Apple buries this setting a few layers deep in iOS/iPadOS:

  1. Open the Settings app
  2. Scroll down and tap Safari
  3. Scroll to the bottom of the Safari settings and tap Advanced
  4. Find the JavaScript toggle and switch it on (green)

That's it. Changes take effect immediately — no restart required. Any tabs already open may need to be refreshed to load JavaScript-dependent content.

Note for iPadOS users: The path is identical. The Safari settings panel may look slightly wider due to the larger screen, but the Advanced menu and JavaScript toggle appear in the same location.

What If the Toggle Is Grayed Out?

A grayed-out JavaScript toggle almost always means the device is under a configuration profile — common on school-issued iPads, corporate iPhones, or devices set up with Screen Time restrictions by a parent or IT administrator. In those cases, the toggle is locked at the system level and cannot be changed from within Settings alone. You'd need to either remove the restricting profile (if you have permission) or contact whoever manages the device.

How to Enable JavaScript on Safari for Mac 💻

The location differs between macOS versions, but the process is straightforward.

macOS Ventura, Sonoma, and Later

  1. Open Safari
  2. Click Safari in the menu bar, then select Settings (or press ⌘ + ,)
  3. Click the Security tab
  4. Check the box next to Enable JavaScript

macOS Monterey and Earlier

The path is nearly the same, but the menu item is labeled Preferences instead of Settings:

  1. Open Safari
  2. Click Safari in the menu bar → Preferences
  3. Click the Security tab
  4. Check Enable JavaScript

Changes apply to new page loads immediately. Existing tabs will need a refresh.

JavaScript Settings vs. Content Blockers: An Important Distinction

Enabling JavaScript in Safari settings is not the same as whitelisting a site in a content blocker. If you're running an ad blocker or privacy extension (like AdGuard, 1Blocker, or similar), that extension may still block specific JavaScript files even when JavaScript itself is globally enabled in Safari.

If a site still seems broken after enabling JavaScript, the culprit is often a content blocker interfering with page scripts — not the Safari setting itself. Disabling the extension for that particular site, or adding it to an allowlist within the extension's own settings, is usually the next troubleshooting step.

How JavaScript Behavior Varies Across Devices and Configurations

FactorEffect on JavaScript
iOS/iPadOS versionOlder versions may render some JS differently or have fewer security controls
MDM/Screen Time profileCan lock the toggle, preventing changes
Content blocker extensionsMay block individual scripts regardless of the global JS setting
Low Power ModeDoes not affect JavaScript execution in Safari
Private Browsing ModeJavaScript works normally; only cookies and history are handled differently

Safari's Per-Site JavaScript Controls (Mac Only)

On macOS, Safari offers a more granular option most users don't know exists. Under Settings → Websites → JavaScript, you can set JavaScript behavior on a per-site basis — allowing it on trusted sites while blocking it on others. This is particularly useful if you want JavaScript globally disabled for privacy but need it working for a handful of specific domains.

This per-site control doesn't exist in the iOS/iPadOS version of Safari, where the JavaScript toggle is a single global switch.

The Variables That Affect Your Specific Situation

Whether re-enabling JavaScript is a simple toggle flip or a more involved process depends on factors unique to your setup: which device you're using, which version of macOS or iOS is installed, whether the device is managed by a profile, and which extensions are active in Safari. A family iPad with Screen Time enabled, a work MacBook under IT management, and a personal iPhone running the latest iOS represent three meaningfully different situations — even though the end goal is identical. The steps above cover the standard paths, but the actual outcome depends on how your specific device is configured.