# JavaScript switcher

The JavaScript switcher turns JavaScript on or off for a site. Use it to see what a page shows without JavaScript, for example to check what a crawler that does not run JavaScript can read.

The switcher uses the JavaScript setting of the browser. The browser keeps a rule for each site that you change.

## Before you start [#before-you-start]

- The switcher works on `http` and `https` pages only.
- After each change, the extension reloads the tab.
- While JavaScript is blocked for the site, the VitalSentinel icon in the toolbar is grey. The tooltip of the icon says "JavaScript blocked".

## Turn JavaScript on or off for the current site [#turn-javascript-on-or-off-for-the-current-site]

Use one of these three ways. Each way changes the rule for the current host only, for example `shop.example.com`.

- **Popup.** In the **Tools** group of the sidebar, use the **JavaScript** switch.
- **Keyboard shortcut.** Press `Alt+Shift+Q`.
- **Right-click menu.** Right-click the page or the VitalSentinel icon, then select **Turn JavaScript on or off for this site**.

## Manage the rules in Settings [#manage-the-rules-in-settings]

The **JavaScript rules** section of [Settings](/browser-extension/settings) lists every rule that you made. If there are no rules, it says "No rules yet. JavaScript runs everywhere."

Each rule shows:

| Column | What it shows |
|--------|---------------|
| **Pattern** | The host, or the domain with `[*.]` in front of it |
| **Applies to** | **This host only**, or **Domain and subdomains** for a `[*.]` pattern |
| **JavaScript** | **Blocked** or **Allowed**. Select the other value to change the rule |
| **Added** | The date when you made the rule |

To remove one rule, click **Remove** on its row. To remove all rules, click **Remove all**.

### Block JavaScript on a host or a domain [#block-javascript-on-a-host-or-a-domain]

1. In Settings, go to the **JavaScript rules** section.
2. Enter a host, for example `shop.example.com`. To include all subdomains, enter `[*.]example.com`.
3. Click **Block JavaScript**.

You can also paste a full address. The rule always covers the whole host.

### Export the rules [#export-the-rules]

Click **Export**. The browser downloads the file `vitalsentinel-js-rules.json` with all your rules.

## Incognito windows [#incognito-windows]

A rule that you make in an incognito window stays only until you close the incognito session, as Chrome requires. These rules do not show in the **JavaScript rules** list.

## Change the keyboard shortcut [#change-the-keyboard-shortcut]

1. In Settings, go to the **Keyboard shortcuts** section.
2. Click **Change shortcuts**.
3. On the shortcuts page of the browser, set a new shortcut for "Turn JavaScript on or off for this site".

## Related [#related]

- [Toolbar badge](/browser-extension/toolbar-badge) - the grey icon while JavaScript is blocked
- [Crawl and index reports](/browser-extension/crawl-and-index-reports#raw-html-vs-rendered-page) - compare the raw HTML with the rendered page
- [Settings](/browser-extension/settings) - all the settings of the extension
