Lessons learned from publishing my first Chrome Extension
Tags: webdev, chrome, bookmarks, javascript
Published: 2020-01-22 08:08:10

---
title: Lessons learned from publishing my first Chrome Extension
published: true
description: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/5sg8t2hhyyzil97f096u.png
tags: webdev, chrome, bookmarks, javascript
---

Recently I have developed a [bookmarklet](https://www.bookmarks.dev/howto) and a [Chrome extension](https://chrome.google.com/webstore/detail/save-to-bookmarksdev/diofdblfhjbpgackifolmboaiccmebjb) to make saving bookmarks to [www.bookmarks.dev](https://www.bookmarks.dev) much easier. In this blog post, I will share with you some lessons learned from this experience. 

## 1. It is easier than expected

Before I started digging into the topic, I thought developing chrome extensions was a sort of "voodoo" thing accessible only to the wizards of web development. But it is not like that. Sure you need to have some basic skills around HTML, JavaScript, CSS, and understand the provided  [Extension APIs](https://developer.chrome.com/extensions/api_index), but the possibilities are almost limitless. 

> See [My list of almost indispensable Chrome Extensions](https://dev.to/ama/my-list-of-almost-indispensable-chrome-extensions-443) to get a glimpse of what I mean. Most of the extensions listed there have also links to their source code. 

[Source code](https://github.com/CodepediaOrg/bookmarks.dev-chrome-extension) for the [**Save to Bookmarks.dev** extension](https://chrome.google.com/webstore/detail/diofdblfhjbpgackifolmboaiccmebjb). 

## 2. Learn from the best?
Although the [documentation](https://developer.chrome.com/extensions) is pretty good and well structured, I learned the most by watching this youtube video series by Daniel Schiffman from The Coding Train:

[![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pp7if8q3dgg03ng7yaxx.png)](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bL9VOMT65ahNEri9uqLWfS)

> It is entertaining and easy to understand.

The accompanying blog article - [Chrome Extensions (and Bookmarklets)](https://shiffman.net/a2z/chrome-ext/) 

## 3. One time 5$ fee for Chrome Web Store
Before you can publish the Chrome Web Store, a one-time $5 developer signup fee. A reminder in the dashboard will appear until you pay the fee.

## 4. The User Interface of Chrome Webstore Developer Dashboard is not optimal 
To say the least... There is a new version but with [lots of limitations](https://docs.google.com/document/d/e/2PACX-1vQi3OH0AE53rgDO1DSSRqLdH0h7790hPKiIHGlayLfhDGyEZWZLmxBQVNuSE4JFR3uj3fjRGY2lOK2J/pub) still. 

> It should stay in the header **Please handle with care** - I, for one, unpublished by mistake the extension. I was trying not to publish (remove from status **Pending**) a small doc update I've done on the metadata, not the extension itself. 

## 5. Have some media available
You need to have some screenshots and optionally a video prepared. They should help the users get started with your extension. Below it's a link to a video for using the [Save to Bookmarks.dev](https://chrome.google.com/webstore/detail/diofdblfhjbpgackifolmboaiccmebjb) extension. 
 
[![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/mh5tmdfoyrg7nd6z37u7.png)](https://www.youtube.com/watch?v=4q12HDjWY44)


## 6. Limit required permissions to only what is needed for the extension's core functionality. 

For example, I injected the content script [programmatically](https://developer.chrome.com/extensions/content_scripts#programmatic) to avoid having to declare a `<all_urls>` matcher in the `content_scripts` section of the manifest file, when the [activeTab permission](https://developer.chrome.com/extensions/permission_warnings#activeTab_permission) suffices. 

The `browserAction` defined in the **background** script will trigger the execution of the content script:

```javascript
chrome.browserAction.onClicked.addListener(iconClicked);

function iconClicked() {
  chrome.tabs.executeScript({
    file: 'content.js'
  });
};

```

## 7. Have some patience before being approved

After publishing the extension, you might need to wait before being [approved to be published in the Chrome Web Store](https://developer.chrome.com/webstore/faq#faq-gen-08). In my case, it took about 2 working days for publishing version 1.0.0 and five working days when publishing version 2.0.0 (it happened over the New Year's eve though, so most approvers might have still been in vacation) 


If you have learned other important lessons about the topic please share them in the comments section below.