Opera support for cross-domain GM_xmlhttpRequest

in Script development
Subscribe to Opera support for cross-domain GM_xmlhttpRequest 7 posts, 5 voices



AndrewGM User

Hi !

I am not an Opera user and I need to know if cross-domain GM_xmlhttpRequest is supported in Opera in anyway.
I haven't been able to find any relevant information.

Thank you.

 
dob Scriptwright

No, it's not.

 
znerp Scriptwright

Someone asked me a question roughly equivalent to this in one of my script comments a few months back. I did some Googling at the time and I found a quite interesting (although quite old) article on the subject here.

 
dob Scriptwright

You can always add cookies when you use Opera, but it definitely does not have a cross-domain XHR solution.
The only thing that comes in my mind is a serverside script that will read a page's content for you, using your cookie. Should be about 20 lines of PHP code
Very, very dangerous and not at all recommendable, but if you use it on your own, go ahead, I guess.

 
Pawelsky Scriptwright

@AndrewGM: yes, it is possible to have cross-domain GM_xmlhttpRequest in Opera. To do so you need the following:
- cross-domain XMLHttpRequest implementation scripts (a-lib-stacktrace.js and a-lib-xmlhttp-cd.js) from here: http://my.opera.com/community/forums/findpost.p... (I suggest to read the entire thread)
- wrapper for GM_* functions (aagmfunctions.js) from here: http://www.howtocreate.co.uk/operaStuff/userjs/... (this is the up-to-date location for the script mentioned by znerp)
- enable the following options in Opera: opera:config#UserPrefs|UserJavaScript and opera:config#UserPrefs|UserJavaScriptonHTTPS
- modify the aagmfunctions.js script to use the cross-domain XMLHttpRequest implementation by changing the following line
var request = new XMLHttpRequest();
into
var request = new opera.XMLHttpRequest();

 
lucideer Scriptwright

@Pawelsky
Are you sure you need to set the UserJavaScriptonHTTPS preference (unless you want to access a particular secure page)

It should probably also be said that that implementation has some limitations. It uses frames so I don't think it supports the POST method. (am I wrong?)

 
Pawelsky Scriptwright
ieWindows

@lucideer
The UserJavaScriptonHTTPS option is needed when you want to use GM scripts on secure webpages.

For the list of limitation please contact the authors of the described scripts (I'm not one of them) or refer the Opera Forum thread mentioned earlier.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel