12월, 2014의 게시물 표시

로컬 파일 시스템(file:/// 프로토콜)에서 실행한 html(js) 파일의 Same Origin Policy(document.domain) 우회하는 방법

experience 로컬 파일을 https 로 접근해서 test할일이 생김 * 실제로는 서버로 띄워서 http로 접근하면 되지만 file:/// 로 접근할 경우에는 Same Origin Policy때문에 쉽지 않음..   * 간단한 방법으로는 Safari를 이용해서 해당 파일(file:///)로 접근하면 되는 듯...  (safari에서 Develop 메뉴 > Disable local file restrictions 과 disable cache 설정하면 됨)     from : https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally       Procedural content If you use just procedural geometries and don't load any textures, webpages should work straight from the file system, just double-click on HTML file in a file manager and it should appear working in the browser (accessed as file:///example). Content loaded from external files If you load models or textures from external files, due to browsers' "same origin policy" security restrictions, loading from a file system will fail with a security exception. There are two ways how to solve this: Change security for local files in a browser (access page as file:///example) Run files from a local server (...