Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by worldspawn · May 24, 2013 at 07:37 PM · webplayersecuritytwitter

Twitter feed in webplayer stops working when I upload my game

I am making a game that is based on a twitter feed and supposed to run in webplayer. I'm using the WWW class to send the http request, and then parse the JSON object that is sent back with my own method.

When I build the webplayer, and run it from my local hard drive, it still works, but when I upload it to the web (in this case a Dropbox public folder) and open it from the online URL, it stops recieving the tweets.

AFAIK there are no debugging options at the point where it's uploaded, so I don't have any error message.

Could it be that this is the webplayer security sandbox? I read the page about it, but if it was a security sandbox thing, why would it still work if I run the webplayer from my local drive?

Does anyone have an idea what it could be and how to fix it?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Stormizin · May 24, 2013 at 07:42 PM

In this case, you would need to place a crossdomain.xml file at the root of the requested link domain like this: http://twitter.com/dir

Imagine the WWW without this security, everyone will pull everything from any link and too much errors will appear.

Thats WHY all this polices: The socket and WWW security features exist to protect people who install the Unity Web Player. Without these restrictions, an attack such as the following would be possible:

Bob works at the white house. Frank is evil. He writes a unity webgame that pretends to be a game, but in the background does a WWW request to http://internal.whitehouse.gov/LocationOfNuclearBombs.pdf. internal.whitehouse.gov is a server that is not reachable from the internet, but is reachable from Bob's workstation because he works at the white house. Frank sends those pdf bytes to http://frank.com/secretDataUploader.php Frank places this game on http://www.frank.com/coolgame.unity3d Frank somehow convinces Bob to play the game. Bob plays the game. Game silently downloads the secret document, and sends it to Frank.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image worldspawn · May 24, 2013 at 07:49 PM 0
Share

So you do think it is the security sandbox? But I can't really by any legal means place my crossdomain.xml on the Twitter domain, right?

avatar image Stormizin · May 24, 2013 at 07:53 PM 0
Share

Your right bro. What you can do its parse the HT$$anonymous$$L tags from the app.

avatar image worldspawn · May 24, 2013 at 07:59 PM 0
Share

Sorry, I don't get it. http://twitter.com/dir is a Twitter account. I'm currently using tweets from #belieber.

avatar image Stormizin · May 24, 2013 at 08:01 PM 0
Share

Actually i mean /dir (directory) of the twitter domain to put the crossdomain.xml file. :P

avatar image worldspawn · May 24, 2013 at 08:04 PM 0
Share

Umm, so what exactly was then your suggestion how to work around my problem?

Show more comments
avatar image
0

Answer by waspfarmer2 · May 30, 2013 at 11:05 AM

If you need to get at twitter, have unity webplayer inject javascript into a the browser and get the browser to fetch the tweets and feed them back into the webplayer.

We've done something similar to overcome the restriction on certain includes. So the user could save an image file we base64 the byte array and injected it in the browser with a piece of javascript which would bring up the browser's save dialog.

This should get you started. With the injection part.

 public TextAsset javascript;
 
 void OnEnable ()
     {
         Application.ExternalEval (javascript.text);
     }
 
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Security.PrefetchSocketPolicy does not work in debug session? 0 Answers

Webplayer sandbox security policy: When do I prefetch security policy? 1 Answer

Help on Security Sandbox of the Webplayer 0 Answers

Protecting my assetbundles 1 Answer

How often should a webplayer communicate with the server? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges