I am attempting to write a user script that makes a cross domain AJAX request.
I have included jQuery inside my script using @require and everything seems to be working fine up until the point where I try to run jQuery.getJSON.
The API I am accessing supports jsonp, however I keep getting an error stating jsonp123456789 is not defined.
From what I have been able to gather this is due to jQuery writing the jsonp response directly into the head of the page, which then becomes sandboxed. Once that has occured jQuery can no longer access the callback resulting in it being undefined. (I'm not 100% on this being the case, but it seems likely to me).
Is there any way to work around this? It has been suggested I declare the callback function inside unsafeWindow but I'm unsure how to do this and haven't managed to get it to work.