{"id":8030,"date":"2017-03-24T04:15:32","date_gmt":"2017-03-24T11:15:32","guid":{"rendered":"http:\/\/blog.mozilla.org\/addons\/?p=8030"},"modified":"2017-06-07T11:12:42","modified_gmt":"2017-06-07T18:12:42","slug":"migrating-adblock-firefox-webextensions","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/","title":{"rendered":"Migrating AdBlock for Firefox to WebExtensions"},"content":{"rendered":"<p><em><a href=\"https:\/\/addons.mozilla.org\/firefox\/addon\/adblock-for-firefox\" target=\"_blank\" rel=\"noopener noreferrer\">AdBlock for Firefox<\/a> is a fast and powerful ad blocker with over 40 million users. They have finished transitioning to <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\" target=\"_blank\" rel=\"noopener noreferrer\">WebExtensions<\/a>, by way of porting their data using <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Embedded_WebExtensions\" target=\"_blank\" rel=\"noopener noreferrer\">Embedded WebExtensions<\/a>. You can read more about the AdBlock extension <a href=\"https:\/\/www.getadblock.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/em><\/p>\n<p><em>For more resources on updating your extension, please check out <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Porting_a_legacy_Firefox_add-on\" target=\"_blank\" rel=\"noopener noreferrer\">MDN<\/a>. You can also contact us via <a href=\"https:\/\/wiki.mozilla.org\/Add-ons\/developer\/communication#Get_in_Touch\" target=\"_blank\" rel=\"noopener noreferrer\">these methods<\/a>.<br \/>\n<\/em><\/p>\n<ol>\n<li>\n<p dir=\"ltr\"><strong>Please provide a short background on your add-on. What does it do, when was it created, and why was it created?<\/strong><\/p>\n<p>We created our original Firefox extension in 2014. We had seen some early success on Chrome and Safari and believed we could replicate that success on Firefox, which had developed a good community of users that downloaded add-ons for Firefox. It seemed like a natural place for us to be.<\/li>\n<\/ol>\n<ol start=\"2\">\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>What add-on technologies or APIs were used to build your add-on?<\/strong><\/p>\n<p>The Firefox Add-On SDK was being promoted at the time, which wasn\u2019t compatible with the Chrome Extension API, so we went through the Chrome code to identify areas where we could leverage work we had done previously. Since the APIs were a little different, we ended up having to modify some modules to use the Firefox Add-on SDK.<\/li>\n<\/ol>\n<ol start=\"3\">\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Why did you decide to transition your add-on to WebExtensions APIs?<\/strong><\/p>\n<p dir=\"ltr\">With the Firefox SDK set to be deprecated, we knew our extension would slowly become unusable, so it made sense to transition to the WebExtension API. The benefit, from our standpoint, was that by using this API our software would be on a similar codebase and have similar features and functionalities to what we do on some of the other browsers we support.<\/p>\n<\/li>\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Walk us through the process of how you are making the transition. How was the experience of finding WebExtensions APIs to replace legacy APIs? What are some advantages and limitations?<\/strong><\/p>\n<p>Last year we ported our Chrome extension to Edge, so when Firefox announced its plans, we had a good idea of what we wanted to do and how to go about it. Also, we were familiar with the WebExtension API from our years working on Chrome, but we knew we needed to educate ourselves on the differences. Fortunately, the Firefox documentation on the difference was very helpful in that education process. These pages, in particular, were helpful:<\/p>\n<p dir=\"ltr\"><a class=\"__postbox-detected-content __postbox-detected-link\" href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Comparison_with_the_Add-on_SDK\">https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Comparison_with_the_Add-on_SDK<\/a><\/p>\n<p dir=\"ltr\"><a class=\"__postbox-detected-content __postbox-detected-link\" href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Chrome_incompatibilities\">https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Chrome_incompatibilities<\/a><\/p>\n<p>We did run into a few challenges. Chrome allows us to create an alert message or a confirm message from the background page (e.g., &#8220;Are you sure you want do this&#8230;&#8221;), and Firefox doesn\u2019t allow us to do that. We use that type of messaging in our Chrome extension that we had to find a workaround for, which we were able to do. For us, this impacted our ability to message our users when they were manipulating custom filters within AdBlock, but was not a major issue.<\/p>\n<p><em>We hope to land Permission capabilities in Firefox 54, and you can read about its implementation progress in the <a href=\"https:\/\/blog.mozilla.org\/addons\/2017\/01\/25\/webextensions-in-firefox-53\/\" target=\"_blank\" rel=\"noopener noreferrer\">WebExtensions in Firefox 53<\/a> blog post.<\/em><\/li>\n<\/ol>\n<ol start=\"5\">\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>What, if anything, will be different about your add-on when it becomes a WebExtension? Will you be able to transition with all the features intact?<\/strong><\/p>\n<p>Anecdotally, the extension appears to be faster, specifically around page load times. But the big advantage, from our perspective, is that we will be able to manage the transition with almost all of our features intact. As a result, we aren\u2019t losing any meaningful functionality of AdBlock, which was our main concern before we embarked upon this transition.<\/p>\n<p>We did notice that a few of the APIs that AdBlock utilizes are not available on Firefox for Android, so we are currently unable to release a new version of AdBlock that supports Firefox for Android. We hope to address this issue in a coming version of AdBlock.<\/p>\n<p><em>We have lots of work <a href=\"https:\/\/trello.com\/b\/PC9kB14s\/webextensions-roadmap?menu=filter&amp;filter=label:Android\" target=\"_blank\" rel=\"noopener noreferrer\">planned<\/a> for Android in upcoming releases, with the goal of making ad blockers possible in <a href=\"https:\/\/wiki.mozilla.org\/RapidRelease\/Calendar\" target=\"_blank\" rel=\"noopener noreferrer\">Firefox 57<\/a>.<\/em><\/li>\n<\/ol>\n<ol start=\"6\">\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>What advice would you give other legacy add-on developers?<\/strong><\/p>\n<p>Make sure you have a migration plan that is well-tested on various versions and operating systems before you start migrating user data. One thing we learned the hard way, when we migrated our users&#8217; data, we generated some migration messages to the console, but those message were not persisted.\u00a0 It would have been more helpful to use if the messages were persisted for a period of time, to aid with debugging any user issues.<\/p>\n<p><em><a href=\"https:\/\/blog.mozilla.org\/addons\/2017\/01\/20\/migrating-to-webextensions-port-your-stored-data\/\" target=\"_blank\" rel=\"noopener noreferrer\">Embedded Extensions<\/a> are available as of Firefox 51 to help you transfer your user data.<\/em><\/li>\n<\/ol>\n<ol start=\"7\">\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Anything else you\u2019d like to add?<\/strong><\/p>\n<p>If you are going to upgrade your extension, only do what\u2019s necessary to get the current functionality working first. Don\u2019t try and do too much in the release that you are using to migrate users over.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>AdBlock for Firefox is a fast and powerful ad blocker with over 40 million users. They have finished transitioning to WebExtensions, by way of porting their data using Embedded WebExtensions. &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/\">Read more<\/a><\/p>\n","protected":false},"author":377,"featured_media":8111,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[388,44,278886],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Migrating AdBlock for Firefox to WebExtensions - Mozilla Add-ons Community Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amy Tsay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/\",\"name\":\"Migrating AdBlock for Firefox to WebExtensions - Mozilla Add-ons Community Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png\",\"datePublished\":\"2017-03-24T11:15:32+00:00\",\"dateModified\":\"2017-06-07T18:12:42+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/becbc6e5c1f9ed8217c36233bc1a7bec\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png\",\"contentUrl\":\"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png\",\"width\":494,\"height\":376},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/addons\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating AdBlock for Firefox to WebExtensions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/\",\"name\":\"Mozilla Add-ons Community Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/becbc6e5c1f9ed8217c36233bc1a7bec\",\"name\":\"Amy Tsay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/db8d681801f2c6406fb3e53d48db2909?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/db8d681801f2c6406fb3e53d48db2909?s=96&d=mm&r=g\",\"caption\":\"Amy Tsay\"},\"description\":\"Lead for Firefox Add-ons at Mozilla.\",\"sameAs\":[\"https:\/\/x.com\/catchingamy\"],\"url\":\"https:\/\/blog.mozilla.org\/addons\/author\/atsaymozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating AdBlock for Firefox to WebExtensions - Mozilla Add-ons Community Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/","twitter_misc":{"Written by":"Amy Tsay","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/","url":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/","name":"Migrating AdBlock for Firefox to WebExtensions - Mozilla Add-ons Community Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/addons\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage"},"image":{"@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png","datePublished":"2017-03-24T11:15:32+00:00","dateModified":"2017-06-07T18:12:42+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/becbc6e5c1f9ed8217c36233bc1a7bec"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#primaryimage","url":"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png","contentUrl":"https:\/\/blog.mozilla.org\/addons\/files\/2017\/03\/Screenshot-2017-03-29-11.56.49.png","width":494,"height":376},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/addons\/2017\/03\/24\/migrating-adblock-firefox-webextensions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/addons\/"},{"@type":"ListItem","position":2,"name":"Migrating AdBlock for Firefox to WebExtensions"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/addons\/#website","url":"https:\/\/blog.mozilla.org\/addons\/","name":"Mozilla Add-ons Community Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/becbc6e5c1f9ed8217c36233bc1a7bec","name":"Amy Tsay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/db8d681801f2c6406fb3e53d48db2909?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db8d681801f2c6406fb3e53d48db2909?s=96&d=mm&r=g","caption":"Amy Tsay"},"description":"Lead for Firefox Add-ons at Mozilla.","sameAs":["https:\/\/x.com\/catchingamy"],"url":"https:\/\/blog.mozilla.org\/addons\/author\/atsaymozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/8030"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/users\/377"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/comments?post=8030"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/8030\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media\/8111"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media?parent=8030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/categories?post=8030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/tags?post=8030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}