Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.
This API is available on Firefox OS for internal applications only.
Summary
WebSMS is an API that makes it possible for web content to create, send, and receive Short Message Service (SMS) or Multimedia Messaging Service (MMS) messages.
The API is available using Navigator.mozSms which returns a MozSmsManager object or Navigator.mozMobileMessage which returns a MozMobileMessageManager. See below for a full list of interfaces:
DOM interfaces
SMS interfaces
Navigator.mozSmsDeprecated since Gecko 25MozSmsManagerDeprecated since Gecko 25MozSmsMessageMozSmsEventMozSmsFilterMozSmsSegmentInfo
MMS and SMS interfaces
Navigator.mozMobileMessageRequires FirefoxOS 1.1MozMobileMessageManagerMozMmsMessageMozMmsEventMozMobileMessageThread
Sample code and introduction
Specifications
This is a non standard implementation, but it is discussed at W3C as part of the System Application Working Group.
| Specification | Status | Comment |
|---|---|---|
| Messaging API | Editor's Draft | Editor Draft (WIP). |
Browser compatibility
For obvious reasons, support is primarily expected on mobile browsers.
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | No support | No support | No support | No support | No support |
| Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | No support | 12.0 (12.0) | 1.0.1 1.1 for MMS |
No support | No support | No support |
Preferences & availability
- WebSMS is disabled by default and can be enabled setting the preference
dom.sms.enabledto true. - A comma-separated whitelist of allowed hostnames that are allowed to use the WebSMS API must be specified using the
dom.sms.whitelistpreference. This string is empty by default. - WebSMS is only available to certified apps on Firefox OS (B2G).
- MMS are available starting with Firefox OS 1.1
See also
- WebSMS API (design document)