The browser extension APIs are designed to promote cross-browser compatibility among extensions. The WebExtension APIs is therefore, to a large extent, code-compatible with the extension API supported by Google Chrome and Opera. Extensions written for these browsers will, in most cases, run in Firefox with just a few changes. Almost all of the WebExtension APIs provide support for callback functions under the chrome namespace, the same as Chrome. The only APIs that are not supported in the chrome namespace are those that are intentionally incompatible with Chrome. In those cases, the API documentation page states that support is provided only in the browser namespace. The process of porting an extension from Chrome or Opera is, therefore, relatively straightforward:

Review your use of manifest.json features and Chrome extension APIs against the Chrome incompatibilities reference. Mozilla provides a service that can help to automate this step: extensiontest.com. If you're using features or APIs that are not supported in Firefox, you may not be able to port your extension.