Is there a way to create a completly isolated javascript environment in python? All I want to do is test if some potentially malicious code calls window.location, iframe.src or something similar, no matter how it tries to obscure this fact. However, I don't want to leave myself open to exploits and I do want to be able to stop the code if runs too long.