Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » General Web Development Discussions

Discuss general web development related issues. For Opera bugs, use the Bug Report Wizard: https://bugs.opera.com/wizard/. For Opera feature requests and queries, use Desktop wish-list: http://my.opera.com/community/forums/forum.dml?id=24.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By Throg anchor Thursday, 31. July 2008, 09:57:01

avatar

Testing Widgets That Use AJAX

I have an Opera widget that makes AJAX calls, but it doesn't seem to be able to issue calls against any server that's on our intranet, including localhost.

If I load the code in the browser by accessing index.html served up by Apache on localhost, everything works fine, but as soon as I load the same code as a widget, any AJAX calls to localhost throw a security violation error message.

At present, I don't have a security section in config.xml, but I've tried adding ...

<security>
<access>
<host>localhost</host>
</access>
</security>

... but that seems to make no difference.

If I change the URL for the AJAX call to point to an external server, it works as a widget but (obviously) not in the browser when loaded from localhost.

Does anyone have any ideas or suggestions please?

By virtuelvis O anchor Wednesday, 6. August 2008, 08:25:16

avatarCurrent shipping versions of Opera do not permit access to localhost, so for now your are out of luck. We may however change this restriction in a future release of Opera.

By Throg anchor Wednesday, 6. August 2008, 16:30:34

avatarI can understand blocking localhost for security reasons, but we don't even seem to be able to access anything on the local network (10.x.x.x), which would have been a suitable workaround.

This is the first AJAX call issued, so we're not falling foul of the intranet vs. internet restriction.

By Schematics2009 anchor Thursday, 25. June 2009, 23:40:40

avatarI have the similar situation.

var http = new XMLHttpRequest();
http.open("POST", "http://localhost:8010/Schematics", true);
...
http.send( SoapXml ); // Here Security violation.

I hasve *.svg file contains Javascript which needs to send SOAP to local SOAP server when user clicks.

At FireFox, I can do by

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");

What can I do at Opera ?

Moderators: pepelsbey | dstorey | mcx | operadev | chrismills | shwetankdixit | brucelawson | iheni | andreasbovens | zibin | mollydotcom