Open Bug 716837 Opened 13 years ago Updated 2 years ago

Cocoa.jsm

Categories

(Toolkit :: General, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: asaf, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: p=8 [qa?])

As Carbon is getting more and more deprecated, and as Core Foundation doesn't really provide all OS X APIs in a regular C Form, there are three options for us for integrating with OS X from JS: 1. Roll our own implementation (as I did with my new Property List Reader, which is also need on windows, so it makes sense). 2. Keep using XPConnect 3. Use ctypes. (1) is not an options most of the time, and when it is, it's usually sub optimal. (2) is the thing we're trying to avoid. (3) is, well, what this bug is about. Because obj-c is a layer on top of C, it seems ctypes can be used as-is to work with objective c APIs. Apple provides this API for introducing such bridges: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html While I don't think we should introduce a fully functional bridge between js to cocoa, we could certainly provide a little wrapper around this (documented!) api, making it easier to use cocoa api when there's no better alternative. It would still leave you with the general ctypes bureaucracy, just cut by a a half or so. Current in-tree use cases I know/care of: 1) Importing Safari's cookies (NSHTTPCookie; The only documented way I know of staring with OS X 10.7). 2) Setting the desktop background (NSWorkspace; Currently we use some old apple event).
Whiteboard: p=0
No longer blocks: fxdesktopbacklog
Flags: firefox-backlog+
Whiteboard: p=0 → p=8 [qa?]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.