Access to 127.0.0.1 by default in Opera 10?
Unlike other browsers (IE, FF, Chrome) Opera 10 doesn't allow websites to access content from localhost. Only when 127.0.0.1 is explicitly added to the trusted websites list in Opera does this work - all other browsers don't need this.
Any suggestions on how I can either programatically add this 开发者_Python百科to the trusted sites list in Opera (unlikely that this is possible), or make Opera hit localhost using some alternate means like some type of cross-domain policy file on my website?
Thanks!
Since this is a security feature it's not supposed to be possible to circumvent it from web content - otherwise it would be no point in having that feature in the first place. What's your use case?
File location in Windows: $USER_FOLDER/Application Data/Opera/Opera/
Ensure opera is closed, append, enjoy.
$ cat trusted_repositories.ini 
Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding
[whitelist]
http://widgets.opera.com
https://widgets.opera.com
http://unite.opera.com
https://unite.opera.com
I'm assuming that you are installing some kind of software on your clients' machines -- otherwise, how can you be certain that there is a webserver at 127.0.0.1? If so, @Autocracy's comment to the question applies: find where the "Trusted Sites" settings are stored, and modify it during the installation.
I am not sure what you are accessing on localhost/127.0.0.1?
Are request browser for a direct file system access? Or is your server running on localhost.
I just tested (on Linux), if your server is bound to 127.0.0.1 interface, opera is allowing the access.
精彩评论