Comments (12)
Try (.log js/console "foo")
and (.write js/document "foo")
.
from austin.
Same problem
(.log js/console "Hello") ;; returns nil, nothing happens
(.write js/document "Hello") ;; hangs
from austin.
What information can I provide to be of use?
(I realize what I have provided is useless for debugging. However, I'm not familiar with cljs-bcrepl debugging and do not know what to provide.)
from austin.
cljs.user=> js/document.URL
"http://localhost:3002/794/repl/start?xpc=...blahblahblah..."
Correct me if I'm wrong. This means when I do (.write js/document), I'm writing into the iframe not the original document.
Simiiarly, when I do (.log js/console) I'm logging into the console of the iframe and not the main document.
Is there a way to retrieve the "main document" that the iframe is embedded into?
Thanks!
from austin.
So I'm trying
js/parent
And I'm getting the following problem:
cemerick.austin is running on localhost:3002
webserver is running on localhost:3000
Thus, I'm getting a cross-domain iframe issue. Is there a way to put some javascript in my webpage to say "allow stuff from localhost:3002" ?
Thanks!
from austin.
With apologies for spamming the issue tracker, I believe the answer is:
http://stackoverflow.com/questions/5008944/how-to-add-an-access-control-allow-origin-header
from austin.
You have multiple issues going on. First, I cannot reproduce any problem with these expressions:
js/parent
(.log js/console "foo")
They produce the results I'd expect. Also, js/document.URL
returns e.g. "http://localhost:38983/2420/repl/start"
, no xpc
parameter.
The one thing I was able to reproduce is that:
(.write js/document "Hello World")
doesn't return: I need to interrupt the evaluation in order to get a prompt back, but the browser-repl is hosed at that point, and I need to :cljs/quit
to get back to the Clojure REPL. However, the indicated text is written to the DOM. I don't have any explanations for that one; there's no cross-domain iframe problem here, since the text does appear, but there's definitely something about that expression that the browser-repl (probably client-side, since no response is returned) doesn't like.
w.r.t. the other problems you're having: what version of Chrome are you using? Can you provide a project and steps to reproduce?
from austin.
I haven't come across the other problems, but (.write js/document "aoeu") executes without termination for me as well.
This is probably because calling .write js/document overwrites the javascript in the page with
html head /head body aoeu /body /html
This happens in the cljs-start template with no changes:
https://github.com/magomimmo/cljs-start
Chromium 31.0.1650.57
Mozilla Firefox 26.0
CIDER 0.5.0alpha (Clojure 1.5.1, nREPL 0.2.3)
[com.cemerick/austin "0.1.3"]
[org.clojure/clojurescript "0.0-2127"]
from austin.
With apologies for multiple open tickets. Is there a reason this is still open? (I.e. for my purposes it's resolved, not sure how this got re-opened.)
from austin.
Yeah, I'd like to keep it open until I have a chance to understand the document.write issue, starting with @johnwalker's theory.
from austin.
(def n (.getElementsByTagName js/document "iframe")) (.remove (aget n 0))
I was off. Removing the iframe is where the problem starts.
from austin.
Confirmed @johnwalker's diagnosis. Thanks!
from austin.
Related Issues (20)
- Eliminate use of CrossPageChannel HOT 3
- Fail gracefully on attempts to use REPL env with disposed session
- Austin should not declare its own ClojureScript dependency HOT 5
- Cljs compiler env doesn't correspond to a refreshed browser env, with (disastrous!) consequences HOT 6
- NullPointerException with Clojurescript 0.0-2173 HOT 5
- NPE against org.clojure/clojurescript "0.0-2173" HOT 1
- Incompatibility with cljs 2173 HOT 1
- austin/exec-env fails w/ cljs 0.0-2173 HOT 3
- Hot reloading of HTML files not working in example project HOT 4
- Inexplicable problems with sample project HOT 3
- Can't require namespaces HOT 1
- Initial namespace not setup properly HOT 1
- Add support for adding JS dependencies. HOT 1
- tools.logging aot issue HOT 2
- Austin not compatible with cljs-2356 HOT 4
- clojurescript 0.0-2665 cannot compile austin 0.1.5 HOT 7
- Add production profile to browser-connected-repl-sample
- After loading (cemerick.austin.repls/exec), forms hang at repl prompt HOT 5
- After loading (cemerick.austin.repls/exec), austin fails with "No value supplied for key:" HOT 4
- Can't start repl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from austin.