Closed Folcon closed 7 years ago
I'm sorry. You don't understand how Javascript interop works in ClojureScript.
If I understand it correctly, (.get.user_email js/gmail)
should make the call.
This is in no way related to chromex.
No problem
Thanks
Please read this article: http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/
Also maybe consider looking into my other library: https://github.com/binaryage/cljs-oops
Where you would call it this way (gcall "gmail.get.user_email" ...)
Thank you, I've finally worked out what the problem was, I wasn't injecting the script into the page in chromex. Now I just need to work out how to communicate with an injected script as I can't seem to access any of the variables :).
I'm currently trying to reproduce a chrome plugin I've written in javascript.
gmail-js is an external dependency that I've managed to load by adding it to the manifest file.
I'm able to test inside the
content_script/core.cljs
that it is loaded.However, when I attempt to call one of the methods I get either a method missing error, or an undefined result. This is despite
js-keys
listing the method in question.The test I'm doing is trying to call:
I've tried calling this the repl:
Which gives me:
However trying to log out the same function to js/console just gives me undefined, even though
js-keys
shows the name"user_email"
and logging the result of.-get
has the function appearing.I'm presently wondering if I'm using this correctly? I assumed that I should have things working on the page in the content_script. Am I mistaken?