changed for use with node webkit, and injection in iframe