Add-ons

User experience best practices

我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

The best Firefox extensions provide users with a new feature or capability that addresses a need. Addressing this need will help users work smarter or more efficiently, or get more pleasure out of their browsing experience.

You will also want to make sure your users have a great experience using your extension and as a result give it great feedback and a good rating on addons.mozilla.org (AMO).

Much has been written about what makes software usable. If you are new to the subject, a good place to start is Jakob Nielsen’s Usability Heuristics. We recommend, whether you are new to extension development or a seasoned pro, using Nielsen’s Heuristics as a checklist when testing your user experience (UX).

So, here we discuss much more specific Firefox and browser extension UX features, offering advice and suggestions that will help you build an extension that delights your users.

Be Firefoxy

Your users have chosen Firefox for a reason, possibly several reasons, so match your extension’s philosophy, features, and look and feel to that of Firefox.

Design values

To best meet the needs of Firefox users, align with the Firefox values.

The Firefox Design Values state that we respect the user's privacy and sovereignty and do not surprise them. We start users with smart defaults on the functionality they want to use and enable them to customize those to their personal preferences so that they are in full control of their experience. We add humor and whimsy to our design and pay attention to details, quality, and performance. Local differences in a global world are important to us, and we help people make sense of the web in clear language.

Look and feel

To provide your extensions with the best long term fit to Firefox, align with the Firefox Photon Design System. Following Photon will ensure that your extension integrates with the Firefox experience and will make it easier for people to use.

Keep it focused

An extension is best when it is centered around one main use case, addressing that use case as well as possible for the target audience. It should add one function or set of closely related functions to the browser, modify a function of the browser, or modify web pages. Judge if you have achieved this by asking whether you can easily communicate the features and purpose of the extension in three (short) sentences or less.

A short summary description of your extension is also very useful when it comes to creating its listing on AMO, see Make sure your summary is just long enough for more details.

Get started right away

Ensure that your extension is ready to be used immediately after installation. It should be optimized for its main use case, and work as expected for most users without the need for customization.

Do not expect your users to read detailed instructions, other content, or ask them to configure the extension to use it. Doing so could mean they never get started with your extension and, if they do, could result in poor reviews.

Give users what they need, where they need it

Choosing the right way or combination of ways to make your extension's functionality available to the user can have a significant impact on usability. Asking a few simple questions about your extension’s functionality can quickly guide you to the right choices:

Does my extension work on most websites and web pages?

If your extension provides the user with features they can use on almost every website or page, give the user access to it from a toolbar button using the browser action. This might include providing access to your image editor or opening a page from your website.

Where you have several features you want to give the user access to, you can add a popup to the button.

Does my extension work for only some web sites and pages?

If your extension offers a feature for a type of web page or specific domains, give the user access to it from an address bar button using a page action. This might include providing access to your RSS reader on pages with RSS feeds or providing an extended feature to pages on your website.

Where you have several features you want to give the user access to, you can add a popup to the button.

Does my extension need to show information or offer actions in parallel with web pages?

If your extension includes information or actions that a user would want immediate access to while viewing any web page, use a sidebar. This might include notes the user can make about a page’s content or a feature offering various font substitutions to improve readability.



Does my extension offer functionality specific to page content or other browser features?

If your extension offers features the user might want to access in context, add them to an appropriate context menu. This might include offering access to an image editor on the image context menu or offering extended copy features on the context menu for selected page content.

Example of content menu items added by a WebExtension, from the context-menu-demo example

Does my extension have settings the user can adjust?

If your extension enables the user to change and save settings that affect the behavior of the extension, use an options page to provide a standard Preferences link to settings from the Add-on Manager.

Typical preferences button, to access an extension's settings, from the Add-on Manager

Does my extension need to gather a lot of information or display content in addition to the current tabs?

Where your extension needs to gather or display significant amounts of information (more than is suitable for an alert or would benefit from additional formatting) use bundled web pages to deliver forms and similar content.

Example of a simple bundled page displayed as a detached panel.

Does my extension try to help the user find web pages or content?

Where your extension includes a use case to locate web pages or content, for example, offering a site specific search, use address bar suggestions to deliver those recommendations.

Example showing the result of the firefox_code_search WebExtension's customization of the address bar suggestions.

Does my extension offer tools for developers?

Where you are providing tools for developers, add them to the Firefox developer tools using developer tools panels.

Keep the user informed

Ensuring the user knows what will happen, is happening, and has happened in your extension is an essential part of building trust and ensuring a happy user.

Tell the user what will happen, before it happens

Users should understand what will happen when they click a button. In addition to a meaningful, descriptive button label, provide tooltips that describe the action that the button will perform.

Do not put the name of the extension alone in the tooltip, unless it is descriptive of the action the button will perform.

Also, do not use the tooltip for any other types of information such as elaborate statistics about your extension. Keep the tooltip content simple and focused on what will happen when the user clicks the button.

If it is really important and the user has wandered away, notify them

If your extension has completed a critical, long running background task, when the task completes use the operating system’s native notifications to update the user. This can be useful where the user may not be focusing on the extension, or the browser, when the process finishes. However, use sparingly. If it is sufficient for the user to discover that a process has completed when they return to the browser or extension, do not use notifications.

Use browserAction badges sparingly

You can add a badge over the toolbar icon of a browserAction, but do so sparingly to inform users about important events. Do not use them to provide regular or persistent status updates.

When it comes to coloring a badge, using one of four colors for notifications of different severity is recommended:

  • Casual: blue
  • Success: green
  • Error: yellow
  • Warning: red

Use of Firefox colors is suggested, for more details see Firefox Colors. However, for compatibility with Chrome and Opera free color selection is supported.

Test, test, and then test again

Testing is a vital part of creating an outstanding UX for your extension. There are two key aspects of testing your UX:

  1. Test across devices and platforms to ensure your extension works and performs well in as many places as possible. This includes considering factors such as the user’s screen size and resolution—just because your extension looks good and is easy to use on your desktop monitor does not mean it looks as good and works as well on a smaller laptop screen, or, indeed, vice versa.
  2. Test with as many users as possible. Do not assume that you know your audience, as people’s backgrounds and experience can make a huge difference to how they interact with your extension. So, allow for user testing as part of your extension’s development.

Testing tips:

  • In AMO you have the option to identify your extension as experimental or publish a beta or other non-final release. If you flag your extension as experimental it is listed in AMO, so that any user can find it, but with a lower profile. Once you are happy that the extension is ready for a wider audience, you can turn off the experimental flag and your extension will be listed as normal in AMO. If you have a published extension, you can use the Development channel to offer an alpha or beta version for testing. You will need to direct your testers to the Development Channel of your extension’s listing or let your testers know the link to use to install your extension.
    The development channel section of an extension's listing page, offering access to alpha and beta versions for testing.
    Once you are happy with your update, you can publish it as the new release version of your extension.
  • If you want to distribute your extension to users outside AMO, you can find the instructions for doing so, and the installation instructions you need to provide users, in the article on Sideloading add-ons. Remember that, unlike distribution through AMO, you will need to send users any updated versions of your extension as you make improvements.
  • Use the Responsive Design Mode to test your extension for its behavior on other screen sizes and device types.

文件標籤與貢獻者

 此頁面的貢獻者: rebloor
 最近更新: rebloor,