Page Speed Optimization Libraries
1.11.33.2
|
#include "support_noscript_filter.h"
Public Member Functions | |
SupportNoscriptFilter (RewriteDriver *rewrite_driver) | |
virtual void | DetermineEnabled (GoogleString *disabled_reason) |
virtual void | StartElement (HtmlElement *element) |
virtual const char * | Name () const |
ScriptUsage | GetScriptUsage () const override |
Inserts a noscript tag as the first element of body. This noscript redirects to "ModPagespeed=off" to prevent breakage when pages rewritten by filters that depend on script execution (such as lazyload_images) are rendered on browsers with script execution disabled.
|
inlineoverride |
Make sure this filter gets turned off when a document is declared as AMP.
This is a little confusing; SupportNoscript does not itself inject scripts, but it injects http-equiv tags which prevent AMP-HTML from being validated. This filter is a special snowflake that is never enabled by users, but is implied by the initial enabling of other filters that do inject scripts.
Because this filter only changes HTML on behalf of filters that are themselves kWillInjectScripts, [falsely] declaring that this script as kWillInjectScripts has no particular downside.