Clojure JIRAhttp://dev.clojure.org/jira
This file is an XML representation of an issueen-us4.464925-07-2011[CLJS-392] Documentation says CLJS can open connections to the REPL server from a "file://" source, and you can'thttp://dev.clojure.org/jira/browse/CLJS-392
ClojureScript<p>At <a href="https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments">https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments</a> there is the following paragraph:</p>
<p>"This is a problem for the browser-connected REPL because FireFox and Chrome both view opening a file from the file system and connecting to localhost:9000 as different domains. <br/>
(...)<br/>
Fortunately, Google has also run into this problem and has created something called a CrossPageChannel. Without going into the details, this allows an iframe served from one domain (the REPL) to communicate with the parent page which was served from another domain (the application server)."</p>
<p>From what I tested, you CANT connect to the REPL server at "http://localhost:9000/repl" if you initially loaded the page using the "file://" protocol. But you can if you loaded it from the same hostname on another port using "http://". The documentation is wrong, and also it needs to be clarified on what you really can change from the initial domain, like the port, without broking the REPL connection (or link to a CrossPageChannel documentation page with the details on what same-origin policy checks it can overcome). </p>ClojureScript 0.0-1450CLJS-392Documentation says CLJS can open connections to the REPL server from a "file://" source, and you can'tDefectTrivialClosedCompletedUnassignedNahuel GrecobugdocsdocumentationTue, 9 Oct 2012 07:54:04 -0500Sat, 27 Jul 2013 16:00:44 -0500Wed, 24 Oct 2012 14:48:48 -050002<p>Are you unable to edit the wiki?</p><p>I didn't know the wiki had public write permissions. Also I don't know the exact CrossPageChannel limitations. </p><p>The limitation is that it won't work with <a href="file://">file://</a>. We now provide a simple webserver that will serve the files present in the directory where you started browser REPL. If you goto <a href="http://localhost:9000/">http://localhost:9000/</a> we will serve index.html if it is present.</p><p>So CrossPageChannel overcomes the "same origin policy" for different ports, but not for different protocols. Thanks for the clarification.</p><p>No problem, closing this one.</p>Global Rank