So basically the issue I am having, is I am working on a simple little JS library for a website, and have run into a bit of an issue. The website is hosted on cloudflare which uses rocket-optimizer. Now my code creates a script element, and the script it loads then should make calls to a server for constant pings, and in the process the server logs various information. This library is working find in other environments, but the rocket-optimizer is killing it.

var dd = document, ll = dd.createElement('script'), ss = dd.getElementsByTagName('script')[0]; ll.type = 'text/javascript'; ll.async = true; ll.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + serverDomain + "/alive?" + params; ss.parentNode.insertBefore(ll, ss);

Now the problem I am having is quite simple really, the rocket.js library has from what I can tell, overloaded document.createElement with its own neat function, which in the event of script tags, gives a "close" copy of the conventional script tag, though it defines a setter/getter for the src property. What the setter does is rather then setting src it puts it into the data-rocketsrc which I have determined then is handled by the rocket-optimizer which passes this back to the pages server, which then does all the calls to my server, passing back the result.

This causes what I'm tracking and doing to completely go out the window for various off topic reasons.

Now I've been trying to find ways to get the original createElement back in the picture, the issue is though since rocket.js is loaded first, and for the moment it appears I have no way to get my script to have priority, I'm kind of stumped with how I can correct this. The thought to possibly redo my own createElement method is a thought, but something I would rather avoid since it adds to what I'm sending and it seems like its something I shouldn't have to send.

Any thoughts and assistance would be greatly appreciated.