Issue #1864944 by Wim Leers: Fixed ajaxPageState does not contain JS files that are in scopes other than 'header'