mock Array.indexOf & add XDomainRequest support