Add some code to put in fake DOM for case when run through JavascriptCore