How To Build a Trello Chrome Extension - Exporting Lists

Originally published at: http://www.sitepoint.com/build-trello-chrome-extension-exporting-lists/

This entry is part 2 of 2 in the series How to Build a Trello Chrome Extension

How to Build a Trello Chrome Extension

In the previous part, we built the basics of our extension, implementing authentication through a custom Foundation-powered settings screen and using Trello’s JavaScript client library. In this part, we’ll finish our extension by adding the exporting logic and UI.

Messaging

When we authenticate with Trello on the settings screen, the Trello token is saved in local storage. However, the settings page is its own page and, effectively, its own environment – ergo, neither the extension’s background page nor the extension’s content scripts have access to it. This is where we need to use message passing.

The chrome.extension.sendMessage API is used to send messages to and from background pages. In our case, we’ll be using it to send the token from the settings page to our background page. Since our settings adventure is done as soon as this is completed, we might as well automatically close the tab, to improve user friendliness.

How to Build a Trello Chrome Extension

Continue reading this article on SitePoint

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.