Hello everybody, I have this Greasemonkey script : http://userscripts.org/scripts/show/56715 and I'd like to have it in my website as an actual JS, so people don't have to install Greasemonley but can still use it. The purpose of this script is to replace in a page each UploadJockey.com's links (which is a multi-uploader) by the real filehosts links. Could someone help me convert it into "actual" non-greasemonkey JS. The source code is available here : http://userscripts.org/scripts/review/56715 Thanks !
not gonna happen that easy - gm has its own XHR method which IS cross-domain (as its from the browser so security limitations don't apply) GM_xmlhttpRequest(); -> the script is using it.
thanks for you answer. So, is there any way to make cross-domain XHR with AJAX ? I found this : http://www.ajax-cross-domain.com and http://cross-domain-ajax.googlecode.com/svn/trunk/cdajax.js but can't get them to work...
you can easily use YQL to proxy the request though. for instance, consider this code i wrote a while back to do just that (through mootools) http://mootools.net/shell/aUgSz/ of the ones you posted, http://www.ajax-cross-domain.com seems to be the proxy for the requests itself, the other one seems to be similar but would rely on you doing your own proxy. basically though, if you 'define' GM_xmlhttpRequest() { ... } to use either method, connect through YQL or your own proxy... and return data in a similar format - then it will work. yahoo's YQL api for that is: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%20=%20%27http://fragged.org%27&format=xml (for instance, to fetch from fragged.org)