{"id":7918,"date":"2016-08-25T09:46:36","date_gmt":"2016-08-25T16:46:36","guid":{"rendered":"http:\/\/blog.mozilla.org\/addons\/?p=7918"},"modified":"2016-08-25T09:46:36","modified_gmt":"2016-08-25T16:46:36","slug":"webextensions-in-firefox-50","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/","title":{"rendered":"WebExtensions in Firefox 50"},"content":{"rendered":"<p><a href=\"https:\/\/wiki.mozilla.org\/RapidRelease\/Calendar#Future_branch_dates\">Firefox 50<\/a> landed in Developer Edition this week, so we have another update on<a href=\"https:\/\/wiki.mozilla.org\/WebExtensions\"> WebExtensions<\/a> for you!Please use the WebExtensions API for any new add-on development, and consider <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Porting_a_legacy_Firefox_add-on\">porting<\/a> your existing add-ons as soon as possible.<\/p>\n<p>It\u2019s also a great time to port because WebExtensions is compatible with multiprocess Firefox, which began rolling out in Firefox 48 to people without add-ons installed. When Firefox 49 reaches the release channel in September, we will begin testing multiprocess Firefox with add-ons. The goal is to turn<a href=\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/02\/multi-process-firefox-and-add-ons-a-call-to-action\/\"> it on<\/a> for everyone in January 2017 with the release of Firefox 51.<\/p>\n<p>If you need help porting to WebExtensions, please start with the <a href=\"http:\/\/compatibility-lookup.services.mozilla.com\/\">compatibility checker<\/a>, and check out these <a href=\"https:\/\/wiki.mozilla.org\/Add-ons\/developer\/communication\">resources<\/a>.<\/p>\n<p>Since the last release, more than<a href=\"https:\/\/bugzilla.mozilla.org\/buglist.cgi?resolution=FIXED&amp;chfieldfrom=2016-06-05&amp;query_format=advanced&amp;chfield=cf_last_resolved&amp;chfieldto=2016-07-29&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;component=WebExtensions&amp;product=Toolkit&amp;list_id=13129678\"> 79 bugs<\/a> were closed on WebExtensions alone.<\/p>\n<h2>API Changes<\/h2>\n<p>In Firefox 50, a few more history APIs landed: the <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/API\/History\/getVisits\">getVisits<\/a> function, and two events&#8211;<a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/API\/History\/onVisited\">onVisited<\/a> and <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/API\/History\/onVisitRemoved\">onVisitRemoved<\/a>.<\/p>\n<p>Content scripts in WebExtensions now gain access to a few export helpers that existed in SDK add-ons: <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Tech\/XPCOM\/Language_Bindings\/Components.utils.cloneInto\">cloneInto<\/a>, <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/SDK\/Guides\/Content_Scripts\/Interacting_with_page_scripts#Create_objects_in_page_script_scope\">createObjectIn<\/a> and <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/SDK\/Guides\/Content_Scripts\/Interacting_with_page_scripts#Expose_functions_to_page_scripts\">exportFunction<\/a>.<\/p>\n<p>The webNavigation API has gained event filtering. This allows users of the webNavigation API to filter events based on some criteria. Details on the URL Filtering option are <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/API\/Events\/UrlFilter\">available here<\/a>.<\/p>\n<p>There\u2019s been a change to debugging WebExtensions. If you go to about:debugging and click on debug you now get all the Firefox Developer Tools features that are available to you on a regular webpage.<\/p>\n<p>Why is this significant? Besides providing more developer features, this will work across add-on reloads and allows the debugging of more parts of WebExtensions. More importantly, it means that we are now using the same debugger that the rest of the Firefox Dev Tools team is using. Reducing duplicated code is a good thing.<\/p>\n<p>As mentioned in an earlier <a href=\"https:\/\/blog.mozilla.org\/addons\/2016\/06\/09\/webextensions-for-firefox-49\/\">blog post<\/a>, native messaging is now available. This allows you to communicate with other processes on the host\u2019s operating system. It\u2019s a commonly used API for password managers and security software, which need to communicate with external processes.<\/p>\n<h2>Documentation<\/h2>\n<p>The <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\">documentation for WebExtensions<\/a> has been updated with some amazing resources over the last few months. This has included the addition of a few new areas:<\/p>\n<ul>\n<li>How-to pages describing how to <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/Intercept_HTTP_requests\">intercept HTTP requests<\/a>, <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/Modify_a_web_page\">modify a web page<\/a>, and so on.<\/li>\n<li>Detailed instructions on porting, including <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Porting_from_Google_Chrome\">porting a Chrome extension <\/a>and <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/Porting_a_legacy_Firefox_add-on\">porting a legacy Firefox add-on<\/a>.<\/li>\n<li>There are also some detailed pages comparing <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Comparison_with_the_Add-on_SDK\">WebExtensions to SDK<\/a> or <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Add-ons\/WebExtensions\/Comparison_with_XUL_XPCOM_extensions\">legacy add-ons<\/a>.<\/li>\n<li>An excellent comparison of <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/WebExtensions\/Browser_support_for_JavaScript_APIs\">what browser implements which APIs<\/a>, which includes data for Microsoft Edge, Google Chrome as well as Firefox and Firefox for Android.<\/li>\n<\/ul>\n<p>The documentation is hosted on MDN and <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/MDN\/Contribute\">updates or improvements to the documentation<\/a> are always welcome.<\/p>\n<p>There are now <a href=\"https:\/\/github.com\/mdn\/webextensions-examples\">17 example WebExtensions on github<\/a>. Recently added are <a href=\"https:\/\/github.com\/mdn\/webextensions-examples\/tree\/master\/history-deleter\">history-deleter<\/a> and <a href=\"https:\/\/github.com\/mdn\/webextensions-examples\/tree\/master\/cookie-bg-picker\">cookie-bg-picker<\/a>.<\/p>\n<h2>What\u2019s coming<\/h2>\n<p>We are currently working on the proxy API. The intent is to ship a slightly different API than the one Chrome provides because we have access to better APIs in Firefox.<\/p>\n<p>The ability to write WebExtensions APIs in an add-on has now landed in Firefox 51 through the implementation of <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1263011\">WebExtensions Experiments<\/a>. This means that you don\u2019t need to build and compile all of Firefox in order to add in new APIs and get involved in WebExtensions. The policy for this functionality is currently under discussion and we\u2019ll have more details soon.<\/p>\n<p>There are also lots of other ways to<a href=\"https:\/\/wiki.mozilla.org\/Add-ons\/Contribute#Improve_add-ons_in_Firefox\"> get involved<\/a> with WebExtensions, so please check them out!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox 50 landed in Developer Edition this week, so we have another update on WebExtensions for you!Please use the WebExtensions API for any new add-on development, and consider porting your &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/\">Read more<\/a><\/p>\n","protected":false},"author":271,"featured_media":0,"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>WebExtensions in Firefox 50 - 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\/2016\/08\/25\/webextensions-in-firefox-50\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andy McKay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/\",\"name\":\"WebExtensions in Firefox 50 - Mozilla Add-ons Community Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\"},\"datePublished\":\"2016-08-25T16:46:36+00:00\",\"dateModified\":\"2016-08-25T16:46:36+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/addons\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WebExtensions in Firefox 50\"}]},{\"@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\/7e1881db0e8a23a4a06695f8a0efd6b8\",\"name\":\"Andy McKay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g\",\"caption\":\"Andy McKay\"},\"description\":\"Andy is an Engineering Manager at Mozilla. As a Canadian he tweets and blogs about curling, skiing, politics, maple syrup, bears and all things from the great white north.\",\"sameAs\":[\"http:\/\/mckay.pub\",\"https:\/\/x.com\/andymckay\"],\"url\":\"https:\/\/blog.mozilla.org\/addons\/author\/amckaymozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WebExtensions in Firefox 50 - 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\/2016\/08\/25\/webextensions-in-firefox-50\/","twitter_misc":{"Written by":"Andy McKay","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/","url":"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/","name":"WebExtensions in Firefox 50 - Mozilla Add-ons Community Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/addons\/#website"},"datePublished":"2016-08-25T16:46:36+00:00","dateModified":"2016-08-25T16:46:36+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/7e1881db0e8a23a4a06695f8a0efd6b8"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/08\/25\/webextensions-in-firefox-50\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/addons\/"},{"@type":"ListItem","position":2,"name":"WebExtensions in Firefox 50"}]},{"@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\/7e1881db0e8a23a4a06695f8a0efd6b8","name":"Andy McKay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ad304e7a7d4f6fba05a81b10810fe6fd?s=96&d=mm&r=g","caption":"Andy McKay"},"description":"Andy is an Engineering Manager at Mozilla. As a Canadian he tweets and blogs about curling, skiing, politics, maple syrup, bears and all things from the great white north.","sameAs":["http:\/\/mckay.pub","https:\/\/x.com\/andymckay"],"url":"https:\/\/blog.mozilla.org\/addons\/author\/amckaymozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7918"}],"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\/271"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/comments?post=7918"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7918\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media?parent=7918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/categories?post=7918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/tags?post=7918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}