Non-standard
Provides support for sending and managing SMS messages on a device with WebSMS. Currently implemented as MozSmsManager.
Methods
delete(jsval param)- Deletes a message and returns an
SmsRequestobject (whereSmsRequest.resultis a Boolean reflecting whether the message was deleted). A message id or anSmsMessageobject can be used as a parameter. getMessage(long id)- Gets a message with the specified
idand returns anSmsRequestobject whereSmsRequest.resultis anSmsMessage. getMessages(SmsFilter filter, boolean reverse)- Gets messages, which are specified using an
SmsFilterobject. The order can be reversed using a boolean as a second parameter. AnSmsRequestobject whereSmsRequest.resultis anSmsCursoris returned. getNumberOfMessagesForText(DOMString text)- Returns the number of multi-part SMS needed for a given text (160 characters for one SMS).
markMessageRead(long id, boolean aValue)- Marks a message with the specified
idas read or unread depending on the BooleanaValue. AnSmsRequestobject is returned. send(DOMString[] number, DOMString message)- Sends a message to a specified number. If
numberis aDOMString(only one number) anSmsRequestobject is returned. Ifnumberis an array ofDOMStrings(multiple numbers) an array ofSmsRequestobjects is returned.
Events
ondelivered- A handler for a "delivered" event; this
SMSEventis sent whenever an SMS is delivered to a recipient. onreceived- A handler for a "received" event; this
SMSEventis sent whenever an SMS is received. onsent- A handler for a "sent" event; this
SMSEventis sent whenever an SMS is sent.
Browser compatibility
For obvious reasons, support is primarily expected on mobile browsers.
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | Not supported | 12.0 (12.0) moz | Not supported | Not supported | Not supported |
markMessageRead method | Not supported | 15.0 (15.0) | Not supported | Not supported | Not supported |
Specification
Not part of any specification; however, a proposal is expected based on the WebSMS design document.


Mozilla Developer Network