Skip to content

Release v0.2.0

Compare
Choose a tag to compare
@github-actions github-actions released this 19 Nov 09:44

Complete Firefox support

UnTab is a tool to improve browser productivity and since its creation, browser compatibility has always been in mind during its development. UnTab is now fully supported on Firefox alongside Chrome! On the technical side, the codebase has shifted to using webextension-polyfill which not only provides a more modern browser API for the extension development but is also compatible with both Firefox and Chrome. It has simplified some parts of the codebase which were starting to become confusing due to callbacks!

Plugin API improvements

From the release of version 0.1.0, a sendResponse callback was passed as an argument in the handler method of plugins. This function was used to pass back some data to the UnTab interface. This function was mandatory to be called in every plugin and I had mentioned that this behavior would soon be improved.

I'm glad to share that the sendResponse callback method is no longer passed 😛. Its functionality can now be achieved by simply returning the data from the handler method 🎉

Example of how this change works:
Before: with sendResponse

{
  ...
    async handler({ theme }, sendResponse) {
      await browser.storage.local.set({ theme });
      sendResponse({ theme, autoClose: false });
    }
  ...
}

Now: without sendResponse

{
  ...
    async handler({ theme }) {
      await browser.storage.local.set({ theme });
      return { theme, autoClose: false };
    }
  ...
}

This change makes the Plugin API easier to understand without thinking in terms of callbacks. NOTE: The example shows an async method but the change is also compatible with non-async functions.

Changes in data passing

Communication between the UnTab interface and the background script were done in two ways:

  • Using ports
  • Using sendMessage

sendMessage was used to exchange data about the selected items from the UnTab interface. While it worked the way it was meant to, it had some quirks with respect to asynchronous handlers and how the response data was being passed. This has now been refactored to use ports for communication.

Loading indicator

UnTab now shows a loading indicator when the search takes more than 500ms. Only in some rare cases, the search takes a long time(which is mostly observed during the initial boot of the browser) which is when the loading indicator is shown.