StringInspector strHead = strResultInspector.substring(headStartIdx + Tag.HEAD.start.length(), headEndIdx);
int scriptStartIdx;
// process javascript libraries and javascripts (init scripts)
final String scriptEndStr = Tag.SCRIPT.end;
while ((scriptStartIdx = strHead.indexOfIgnoreCase(SCRIPT)) > -1) {
int scriptEndIdx = strHead.indexOfIgnoreCase(scriptEndStr) + scriptEndStr.length();
StringInspector script;
boolean endOfString = scriptEndIdx > strHead.toString().length() - 1;
if (endOfString) {
script = strHead.substring(scriptStartIdx);