Closed tulssinep closed 5 years ago
Hi. I don't think AngularJS exposes the services in the global scope. The best way would be to run a development setup locally and to set a breakpoint (e.g. using the debugger
keyword in JS or using the browser tools). This also has the advantage of showing the original TypeScript code.
For reference, most of the logic is in src/services/webclient.ts
and src/partials/messenger.ts
. Data structures are defined in src/threema/container.ts
.
If you have any questions, let us know!
Ah and btw, if you just want to log the messages being sent back and forth between app and browser, you can also turn on MSG_DEBUGGING
in src/config.ts
! [Protocol docs]
Ahh too bad, thank you for your reply tho. Maybe I will find a way to get the Service public. I've found a workaround from 2014 which unfortunately doesn't work anymore
Why do you need access to the service?
I'd like to be able to grab the top two conversations without having to have to host the web interface on my own server. For me the most convenient way would be to still access the "original" web.threema.ch website but injecting my own Javascript to it so that I don't need to set up a custom version on my own server.
That's why I was hoping to have the chat data written to something like window.localStorage
for example.
No, we don't want to store the data in local storage due to privacy reasons.
Are you aware that hosting Threema Web is just copying a few static files to a webserver directory? You should probably even be able to serve it from localhost. (The threema-web package on AUR does that for example, by using "python -m http.server".)
Hey, I totally understand and respect that but I don't see what difference "hiding" the data would make when someone can just read out the DOM contents (surely slower but it would also reach all the chats if ran long enough).
Thanks for all your replies man I appreciate it!
Yes, we are not actively hiding the data (although pollution of the global namespace is generally a bad thing), but we won't actively expose it either :slightly_smiling_face:
Hey I am trying to play around a bit and now trying to find a way how to access the top 2 chats in the list. By breakpointing I've found that WebClientService seems to play a role in this - now how can I access it?
While having the website paused in Chrome's debugger, accessing WebClientService by typing its name into the console gives
VM7510:1 Uncaught ReferenceError: WebClientService is not defined at eval (eval at $apply (angular.js?v=2.1.2:19469), <anonymous>:1:1) at Scope.$apply (angular.js?v=2.1.2:19469) at WebClientService.handleIncomingMessage (app.js?v=2.1.2:21175) at WebClientService.handleIncomingMessageBytes (app.js?v=2.1.2:21156) at Unchunker.notifyListener (chunked-dc.es5.js?v=2.1.2:331) at Unchunker.add (chunked-dc.es5.js?v=2.1.2:305) at WebClientService.receiveChunk (app.js?v=2.1.2:21146) at app.js?v=2.1.2:18911 at RelayedDataTask.callHandler (saltyrtc-task-relayed-data.es5.js?v=2.1.2:224) at RelayedDataTask.emit (saltyrtc-task-relayed-data.es5.js?v=2.1.2:201)
and outside of the website in paused state it will just say
Uncaught ReferenceError: WebClientService is not defined at <anonymous>:1:1
Can you point me in the right direction with this? Or is there some other object that I can access in order to get the 2 conversations?