This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Description
What steps will reproduce the problem?
1. Make sure that defer_javascript filter is enabled.
2. Create page that loads at least one script element (doesn't matter which
script, I'm using a popular Google-hosted library as an example), plus a second
script element with an alert().
3. Load the page.
What is the expected output?
Script to run, alert to fire (which worked in 1.6.x)
What do you see instead?
Script runs with error "PSA Error: Exception while overriding
document.readyState.defineProperty is not supported on DOM Objects.", alert
never fires.
What version of the product are you using (please check X-Mod-Pagespeed
header)?
1.7.30.4-3847
On what operating system?
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Which version of Apache?
2.2.15
Which MPM?
Prefork
URL of broken page:
With Filter:
http://www.harvest.org/JustinB/pagespeed_test.html?ModPagespeedFilters=defer_jav
ascript
Without Filter:
http://www.harvest.org/JustinB/pagespeed_test.html?ModPagespeedFilters=-defer_ja
vascript
---------
I've had end-users confirm this behavior in older Safari builds (which they
can't upgrade from because Apple locks this on old OSes), and am able to
recreate it in BrowserStack as well (with extensions disabled). Safari 5.1+
seems to be unaffected. I've also seen someone else report this behavior on the
ngx_pagespeed tracker (https://github.com/pagespeed/ngx_pagespeed/issues/643).
For now, I'll need to disable the filter on the server (so I've included it in
the links above). Please let me know if there are any other details needed.
Original issue reported on code.google.com by Justin.M...@gmail.com on 9 Apr 2014 at 10:09