Where is the source code of chrome://webrtc-internals ?

1,302 views
Skip to first unread message

ftv dev

unread,
Feb 17, 2014, 8:28:24 AM2/17/14
to discuss...@googlegroups.com
I would like to add some new statistics in the chrome page chrome://webrtc-internals. However, I didn't succeed to localize its source code files.
Do you have any idea about the different source code file that are used to create the chrome://webrtc-internals page ?



André Susano Pinto

unread,
Feb 17, 2014, 8:35:16 AM2/17/14
to discuss...@googlegroups.com
https://code.google.com/p/chromium/codesearch#search/&q=webrtc-internals&sq=package:chromium&type=cs

JS UI is driven by webrtc_internals.js, which communicates with the browser via chrome.send.



On Mon, Feb 17, 2014 at 2:28 PM, ftv dev <ftv...@gmail.com> wrote:
I would like to add some new statistics in the chrome page chrome://webrtc-internals. However, I didn't succeed to localize its source code files.
Do you have any idea about the different source code file that are used to create the chrome://webrtc-internals page ?



--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Duong Nguyen

unread,
Mar 12, 2014, 5:57:27 AM3/12/14
to discuss...@googlegroups.com
Hi André Susano Pinto ,

When view source of "chrome://webrtc-internals" i see two file : webrtc-internals.js and util.js.
I am building a project to monitor WebRTC. can i use the code in webrtc-internals.js and util.js to append in my code?
please help me!

Vào 20:35:16 UTC+7 Thứ hai, ngày 17 tháng hai năm 2014, André Susano Pinto đã viết:

André Susano Pinto

unread,
Mar 12, 2014, 8:59:56 AM3/12/14
to discuss...@googlegroups.com
No you can't use webrtc-internals.js mechanism into a normal page... it relies on chrome.send which is only available for special chrome pages.

The only API you have to gather stats on a normal page is the pc.getStats().
What kind of stats from webrtc-internals are you not able to get from getStats() or from intersecting calls into the pc created on your code?



For more options, visit https://groups.google.com/d/optout.

Duong Nguyen

unread,
Mar 12, 2014, 9:50:45 AM3/12/14
to discuss...@googlegroups.com
Hi André Susano Pinto,

I have a server (server A) use WebRTC video call. If i use getStats() i need insert code into this server  (server A).
But I want create new server( server B) to monitor server A. ( i do not change code in server A).
 (I think my server B may be same chorome://webrtc-internals )
Please help me!

Duong Nguyen,
Thanks.

Vào 19:59:56 UTC+7 Thứ tư, ngày 12 tháng ba năm 2014, André Susano Pinto đã viết:

André Susano Pinto

unread,
Mar 12, 2014, 11:25:52 AM3/12/14
to discuss...@googlegroups.com
Hi Duong Nguyen,
Allowing your "server b" to inspect peer connections created in the context of "server a" would be a security issue.

Alternatively you could look if it is possible on having a chrome extension that overrides webkitRTCPeerConnection of server A pages such that it injects code to perform stats on it.
Would be interesting to see that, so keep us updated if you try that route :)

Good luck,
André

Duong Nguyen

unread,
Mar 12, 2014, 10:08:35 PM3/12/14
to discuss...@googlegroups.com
Hi André,

I will send for you my code demo: https://app.box.com/s/jt01djl0ps4a2e6uoeqe
I use webrtc.io lib, websocket and nodejs server.
You can run demo with conmand line in folder site : node server.js
Open chrome browser with addess: localhost:2014.
Some stats will be create in site folder.

you say"if it is possible on having a chrome extension that overrides webkitRTCPeerConnection of server A pages such that it injects code to perform stats on it." But I do not have any way to  overrides webkitRTCPeerConnection of server A pages in may server( server B). I see chrome://webrtc-internals do it. 

But I'm not smart enough to understand it :(


Vào 22:25:52 UTC+7 Thứ tư, ngày 12 tháng ba năm 2014, André Susano Pinto đã viết:

André Susano Pinto

unread,
Mar 13, 2014, 4:08:01 AM3/13/14
to discuss...@googlegroups.com
Note that "chrome://" are pages inside chrome with special capabilities that pages from a server won't have. The ability to inspect any page peer connections is one of those capabilities.

I would recommend you to learn on what a chrome extension is so you understand my suggestion on how to override webkitRTCPeerConnection.
Mainly you would be interested in content_scripts and their run_at property set to document_start.

"""In the case of "document_start", the files are injected after any files from css, but before any other DOM is constructed or any other script is run." - https://developer.chrome.com/extensions/content_scripts

Duong Nguyen

unread,
Mar 13, 2014, 10:04:54 PM3/13/14
to discuss...@googlegroups.com
Hi André,

Thanks for your help :)
You are very kind and enthusiastic

But with chrome extension only perform in chrome. i want also perform in FF and Opera :(...
Have you any another way?

I google search and found callstats.io

What do you think about that?

Vào 15:08:01 UTC+7 Thứ năm, ngày 13 tháng ba năm 2014, André Susano Pinto đã viết:

André Susano Pinto

unread,
Mar 14, 2014, 8:58:05 AM3/14/14
to discuss...@googlegroups.com
"""The following steps need to be completed before integrating callstats.js into a WebRTC application.
callstats.js depends on other common libraries that SHOULD be included in the HEAD tag."""

So that breaks your requirement of "i do not change code in server A".

If you are not willing to drop that requirement you have 2 options:
 - Run something to inject modifications on your application (e.g. modify content on the fly via a proxy, modify content by using extensions or mozilla add-ons or whatever Opera equivalent is).
 - Sniff the rtp encrypted traffic and try to gather stuff from it.

Duong Nguyen

unread,
Mar 16, 2014, 1:06:23 AM3/16/14
to discuss...@googlegroups.com
Hi André Susano Pinto,

Ahhh, i can add my file in server A:
e.g: 
   <script src="/fileWebRTCServerA.js"></script>
   <script src="/myfiletogetstats.js"></script>

In fileWebRTCServerA.js i do not change code.
But in myfiletogetstats.js (myfile add new) to get Stats of PeerConnection. How do I get the peercopnnection without interested code in fileWebRTCServerA.js?

Thanks!

Vào 19:58:05 UTC+7 Thứ sáu, ngày 14 tháng ba năm 2014, André Susano Pinto đã viết:
Reply all
Reply to author
Forward
0 new messages