ariya/phantomjs — pull request #12115 by melletron (2014-04-04 10:19:15+00:00)
Title: Salvage the global JSON object if it got overwritten by front-end developers

Some evil minded CMS developers decided to claim the global object JSON as their own. Although you can't really blame them for that since JSON wasn't mainstream a couple of years back, it now causes major trouble if we want to use phantomJS to do headless operations.

I've updated this file to check if JSON and JSON.parse exist, if it does it tries to use it, if it doesn't it creates an iframe to salvage the JSON object from there. The global variable name there is a MD5 hash of the word 'phantomjs'.