Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC, Firefox nightly and Object.defineProperty #8361

Closed
DartBot opened this issue Feb 6, 2013 · 18 comments
Closed

WebRTC, Firefox nightly and Object.defineProperty #8361

DartBot opened this issue Feb 6, 2013 · 18 comments
Assignees
Milestone

Comments

@DartBot
Copy link

@DartBot DartBot commented Feb 6, 2013

This issue was originally filed by sami.ylon...@gmail.com


Attemped to run some webrtc code compiled to js in latest firefox nightly and aurora.

What seems to happend is that assigning a callback to the onIceCandidate event throws with NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object.

After some tracing it seems that the dart2js generated code attempts to insert property get$onIceCandidate in the RTCPeerConnection object which looks like "[xpconnect wrapped nsIDOMRTCPeerConnection]".

the code that attempts to create the property looks like this: Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true});

https://developer.mozilla.org/en-US/docs/JavaScript-DOM_Prototypes_in_Mozilla seems to claim that native dom objects dont have properties but the properties come from the obj.proto..

I aint clever enough to figure if this is the case =)

What version of the product are you using? On what operating system?

Dart Editor version 0.3.4_r18115
Dart SDK version 0.3.4.0_r18115

@floitschG
Copy link
Contributor

@floitschG floitschG commented Feb 6, 2013

Tentatively assigning to dart2js.


cc @rakudrama.
Added Area-Dart2JS, Triaged labels.

@kasperl
Copy link
Contributor

@kasperl kasperl commented Feb 6, 2013

Added this to the M3 milestone.

@DartBot
Copy link
Author

@DartBot DartBot commented Feb 13, 2013

This comment was originally written by sami.y...@gmail.com


This gist makes firefox nightly throw the error.
https://gist.github.com/samiy-xx/4945442

At the moment, if you want to test this on firefox nightly, you have to browse to about:config, search for the media.peerconnection.enabled and set it to true.

@anders-sandholm
Copy link
Contributor

@anders-sandholm anders-sandholm commented Feb 26, 2013

Removed this from the M3 milestone.
Added this to the M4 milestone.

@efortuna
Copy link
Contributor

@efortuna efortuna commented Mar 18, 2013

This looks like an HTML lib issue. I'll investigate.


Removed Area-Dart2JS label.
Added Area-HTML label.

@efortuna
Copy link
Contributor

@efortuna efortuna commented Mar 19, 2013

The initial issue is for ff, the constructors are called "mozRTCSessionDescription" and "mozRTCIceCandidate" whereas in chrome they are unprefixed. This will work just fine with Chrome. I added these prefixes, but then ran into another XPC exception when trying to use the constructed object, so this needs further investigation.

@blois
Copy link

@blois blois commented Apr 3, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@DartBot
Copy link
Author

@DartBot DartBot commented May 3, 2013

This comment was originally written by sami.ylo...@gmail.com


Has there been any progress with this?

@blois
Copy link

@blois blois commented May 14, 2013

cc @efortuna.

@DartBot
Copy link
Author

@DartBot DartBot commented May 21, 2013

This comment was originally written by sami.ylo...@gmail.com


As suggested here https://groups.google.com/a/dartlang.org/forum/?fromgroups#!topic/html-dev/9Z8FvfjCfbo I'll try this again =)

Has there been any progress with this bug?

@sethladd
Copy link
Member

@sethladd sethladd commented May 23, 2013

@efortuna
Copy link
Contributor

@efortuna efortuna commented May 23, 2013

I'm looking at it again today.

@efortuna
Copy link
Contributor

@efortuna efortuna commented May 25, 2013

Two fixes coming down the pipeline. The first one: https://codereview.chromium.org/16023011/ will be checked in shortly. This will allow you to correctly construct a number of the RTC firefox elements.

The second one we are waiting to be pushed from Firefox nightly to their stable release. Basically RTCPeerConnection does not implement EventTarget and have an "addEventListener" as it should, but this fix should arrive in Firefox stable in a few weeks (it's fixed in Firefox nightly).

@sethladd
Copy link
Member

@sethladd sethladd commented May 25, 2013

Thanks for the update!

@efortuna
Copy link
Contributor

@efortuna efortuna commented May 28, 2013

The fix has been checked in as of 23298. Keep in mind we're still waiting on the additional fix to come through when Firefox itself updates that will let you to set "onIceCandidate". Should see that in a few weeks.


Set owner to @efortuna.
Added Fixed label.

@DartBot
Copy link
Author

@DartBot DartBot commented May 28, 2013

This comment was originally written by sami.ylone...@gmail.com


Thanks Emily.
Is this supposed to work on nightly while we wait for stable to update?

Tried this on nightly 24 but got another error now:
TypeError: $.getInterceptor$x(...).$$dom_addEventListener$3 is not a function

$.$$dom_addEventListener$3$x = function(receiver, a0, a1, a2) {
return $.getInterceptor$x(receiver).$$dom_addEventListener$3(receiver, a0, a1, a2);
};

@efortuna
Copy link
Contributor

@efortuna efortuna commented May 29, 2013

Pull down the latest build (23313) and try again. It should work now.

@DartBot
Copy link
Author

@DartBot DartBot commented May 29, 2013

This comment was originally written by sami.ylone...@gmail.com


Getting there. RTCDataChannel is still not working though =)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants