Skip to main content

filter · JavaScript filters

Disable JavaScript (disable_javascript)

Category:
JavaScript
CoreFilters:
No
OptimizeForBandwidth:
No
Risk:
Dangerous set

Wraps every <script> in <noscript> so no script on the page runs, to measure what the page looks like and costs without JavaScript. For measurement only. In the dangerous set.

When to use it

  • In the dangerous set: no RewriteLevel enables it, not even AllFilters. It exists for testing and measurement, not for production traffic.
  • Risk rating on these docs: Dangerous.

Risks

The JavaScript filters page lists no specific risks for this filter. If a page misbehaves with it, DisableFilters disable_javascript turns it off for the scope you set it in.

Configuration

Enable it in the module configuration, at server, virtual-host or location scope:

Apache

ModPagespeedEnableFilters disable_javascript

nginx

pagespeed EnableFilters disable_javascript;

IIS (pagespeed.config)

pagespeed EnableFilters disable_javascript

Scoping, ForbidFilters and the thresholds filters read: Choosing filters .

Frequently asked questions

What does the disable_javascript filter do?
Wraps every <script> in <noscript> so no script on the page runs, to measure what the page looks like and costs without JavaScript. For measurement only. In the dangerous set.
Is disable_javascript enabled by default?
No. disable_javascript is in the dangerous set, which no RewriteLevel enables, not even AllFilters. Enable it by name, for testing and measurement only.
How do I enable disable_javascript on Apache and nginx?
Add ModPagespeedEnableFilters disable_javascript on Apache or pagespeed EnableFilters disable_javascript; on nginx. On IIS, add pagespeed EnableFilters disable_javascript to pagespeed.config.

This page is drawn from the disable_javascript entry on JavaScript filters. Every filter in one table: PageSpeed filters.

Search