Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at

This API is available on Firefox OS for internal applications only.

This API is used to get information about the current mobile voice and data connection states of the device. It is accessible through navigator.mozMobileConnections, which returns an array of MozMobileConnection objects.

Note: The syntax used to be window.navigator.mozMobileConnection, returning a single MozMobileConnection object, but this was updated in Firefox 1.3 due to the introduction of Multi-SIM support (Dual-SIM-Dual-Standby or DSDS).

Interface overview

callback EventHandler = any (Event event);

interface MozMobileConnection : EventTarget
  const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
  const long ICC_SERVICE_CLASS_DATA = (1 << 1);
  const long ICC_SERVICE_CLASS_FAX = (1 << 2);
  const long ICC_SERVICE_CLASS_SMS = (1 << 3);
  const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
  const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
  const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
  const long ICC_SERVICE_CLASS_PAD = (1 << 7);
  const long ICC_SERVICE_CLASS_MAX = (1 << 7);

  readonly attribute MozMobileConnectionInfo voice;
  readonly attribute MozMobileConnectionInfo data;
  readonly attribute DOMString networkSelectionMode;
  readonly attribute DOMString iccId;

  DOMRequest getNetworks();
  DOMRequest selectNetwork(MozMobileNetworkInfo network);
  DOMRequest selectNetworkAutomatically();
  DOMRequest sendMMI(DOMString mmi);
  DOMRequest cancelMMI();
  DOMRequest setCallForwardingOption(MozMobileCFInfo CFInfo);
  DOMRequest getCallForwardingOption(unsigned short reason);

  attribute EventHandler onvoicechange;
  attribute EventHandler ondatachange;
  attribute EventHandler onussdreceived;
  attribute EventHandler ondataerror;
  attribute EventHandler oncfstatechange;


MozMobileConnection.voice Read only
A MozMobileConnectionInfo object that gives access to information about the voice connection. Read only
A MozMobileConnectionInfo object that gives access to information about the data connection.
MozMobileConnection.iccId Read only
A string that indicates the Integrated Circuit Card Identifier of the SIM this mobile connection corresponds to.
MozMobileConnection.networkSelectionMode Read only
A string that indicates the selection mode of the voice and data networks.
A handler for the cfstatechange event. This event is fired when the call forwarding state changes.
A handler for the datachange event. This event is fired whenever the data connection object changes values.
A handler for the dataerror event. This event is fired whenever the data connection object receive an error from the RIL.
A handler for the ussdreceived event. This event is fired whenever a new USSD message is received.
A handler for the voicechange event. This event is fired whenever the voice connection object changes.




Note: All original methods from the MozMobileConnection interface are fully asynchronous. They all return a DOMRequest which has a onsuccess and onerror event handler to handle the success or failur of the method call.

Cancel the current MMI request if one exists.
Queries current call forward options.
Search for available networks.
Manually selects a network, overriding the radio's current selection.
Tell the radio to automatically select a network.
Send a MMI message.
Configures call forward options.

The MozMobileConnection interface also inherit from the EventTarget interface

Register an event handler of a specific event type on the EventTarget.
Removes an event listener from the EventTarget.
Dispatch an event to this EventTarget.

Additional methods for Mozilla chrome code

Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL bindings.

  • void setEventHandler(DOMString type, EventHandler handler)
  • EventHandler getEventHandler(DOMString type)


The following snippet returns an array of strings that correspond to MCCs, which can be mapped back to countries or even continents based on the first digit (see Mobile country code for a useful reference.) This is useful for redirection logic.

var mcc_mnc = (function () {
 function f (c) { return !!c.lastKnownHomeNetwork && !!c.lastKnownNetwork; };
 function m (c) {
   var s = (c.lastKnownHomeNetwork || c.lastKnownNetwork).split("-");
   return { mcc: s[0], mnc: s[1], };
 return function () {
   if ("mozMobileConnections" in navigator) {
     return, f).map(m);
   } else if ("mozMobileConnection" in navigator) {
     return [navigator.mozMobileConnection].filter(f).map(m);
   } else {
     return [];


Not part of any specification

See also

Document Tags and Contributors

 Last updated by: chrisdavidmills,