Thunderbird (and probably Firefox) does not have default pref for dom.mozTCPSocket.enabled

RESOLVED INVALID

Status

()

defect
RESOLVED INVALID
7 years ago
7 years ago

People

(Reporter: dlech, Unassigned)

Tracking

18 Branch
mozilla18
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I am using nsIDOMTCPSocket in a Thunderbird extension. 

From error console:

Error: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]
Source File: file:///c:/dev/tb/obj/mozilla/dist/bin/components/TCPSocket.js
Line: 290

Found that Bug 770778 broke it because the preference ddom.mozTCPSocket.enabled is missing.

I am thinking that the default pref should be added to mozilla/modules/libpref/src/init/all.js

it currently only exists in /mozilla/b2g/app/b2g.js
Posted patch patch v1Splinter Review
Attachment #696659 - Flags: review?(bent.mozilla)
mozTCPSocket isn't really a stable API surface at this time.  It's currently intended just for v1 of Firefox OS.  Since you're in Thunderbird, I would suggest reusing the socket.jsm module provided by the chat subsystem imported from instantbird, potentially just by copying it to your extension:
http://mxr.mozilla.org/comm-central/source/chat/modules/socket.jsm

For v2 we are hoping to implement startTLS and ideally initiate the standardization process.  Since Chrome has an extension-only API that is rather different, this might potentially result in non-trivial changes to the API...
(In reply to Andrew Sutherland (:asuth) from comment #2)
> mozTCPSocket isn't really a stable API surface at this time.  It's currently
> intended just for v1 of Firefox OS.  Since you're in Thunderbird, I would
> suggest reusing the socket.jsm module provided by the chat subsystem
> imported from instantbird, potentially just by copying it to your extension:
> http://mxr.mozilla.org/comm-central/source/chat/modules/socket.jsm
> 
> For v2 we are hoping to implement startTLS and ideally initiate the
> standardization process.  Since Chrome has an extension-only API that is
> rather different, this might potentially result in non-trivial changes to
> the API...

Does mozTCPSocket == nsIDOMTCPSocket?

Thanks for the link!
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Attachment #696659 - Flags: review?(bent.mozilla)
(In reply to David Lechner (:dlech) from comment #3)
> Does mozTCPSocket == nsIDOMTCPSocket?

Yeah, this is the magic that causes it to get exposed to content, right here:
http://mxr.mozilla.org/mozilla-central/source/dom/network/src/TCPSocket.manifest
1 # TCPSocket.js
2 component {cda91b22-6472-11e1-aa11-834fec09cd0a} TCPSocket.js
3 contract @mozilla.org/tcp-socket;1 {cda91b22-6472-11e1-aa11-834fec09cd0a}
4 category JavaScript-navigator-property mozTCPSocket @mozilla.org/tcp-socket;1
You need to log in before you can comment on or make changes to this bug.