[X3D-Public] Testing Code Locally

Leonard Daly web3d at realism.com
Wed Nov 5 07:17:15 PST 2014


Joe,

This is a browser security issue having to do with the sandbox nature of 
JavaScript.

All browsers (when working as desired) prevent the access to content 
from a different domain than the requesting page. In your case the 
requesting page is in the 'local' domain and the requested content is 
from www.x3dom.org. This is also known as the same origin policy.

A Google search of these terms (including "cross resource sharing 
javascript") show some mechanisms but it was not clear to me if any of 
them would work in this context.

My suggestion is to download everything locally (x3dom.js, x3dom.css, 
bigBuckBunny.ogv, and Peach_Rinkysplash.jpg) and specify a relative URL 
to those files.


The issue of local origin is a known issue that the X3D Working Group is 
addressing for the V4 of the specification. Fraunhofer's work on X3DOM 
is a very important part for determining the future. X3DOM is the 
prototype for V4. We are investigating several different solutions to 
keep this easy for content developers. If you are interested, please 
contact me (web3d at realism.com or from the Web3D.org website).

Leonard Daly
X3D WG Co-Chair




> Ref: Using <MovieTexture> node will not work locally(PC) because of 
> security issues! While testing the following code the Movie was 
> displayed in Black. As it turned out there was a security error which 
> I understand was the reason for displaying the Movie Black.
>
> How is an end User supposed to test their code if this can't be 
> overridden? Can it be overridden?
>
> Thanks.
>
> Joe Lewis
>
> ********************************************************** Code 
> ***********************************************
>
> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 
> 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
>
> <html>
>
> <head>
>
>                <meta http-equiv="content-type" content="text/html; />
>
>     <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
>
>     <title>My first X3DOM page</title>
>
>     <script type='text/javascript' 
> src='http://www.x3dom.org/download/x3dom.js'> </script>
>
>     <link rel='stylesheet' type='text/css' 
> href='http://www.x3dom.org/download/x3dom.css'/>
>
> </head>
>
> <body >
>
> <h1>Hello, X3DOM!</h1>
>
> <p>
>
>     Learn how to use images and videos as texture
>
> </p>
>
> <x3d width='500px' height='400px'>
>
>     <scene>
>
>         <Transform translation='-3.2 0 0'>
>
>         <shape>
>
>            <appearance >
>
>                <MovieTexture repeatS="false" repeatT="false" 
> url='"http://doc.x3dom.org/tutorials/basics/imagesMovies/bigBuckBunny.ogv"'></MovieTexture>
>
>    </MovieTexture>
>
>            </appearance>
>
>            <box ></box>
>
>         </shape>
>
>         </Transform>
>
>         <shape>
>
>             <appearance>
>
>                 <ImageTexture 
> url="http://upload.wikimedia.org/wikipedia/commons/thumb/0/09/Peach_Rinkysplash.jpg/800px-Peach_Rinkysplash.jpg"></ImageTexture>
>
>             </appearance>
>
>             <box></box>
>
>         </shape>
>
>     </scene>
>
> </x3d>
>
> </body>
>
> </html>
>
> ********************************************************************************************************************
>
>
>
> _______________________________________________
> X3D-Public mailing list
> X3D-Public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org


-- 
*Leonard Daly*
X3D Co-Chair
Cloud Consultant
President, Daly Realism - /Creating the Future/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20141105/e89cf1a2/attachment.html>


More information about the X3D-Public mailing list