{"id":5601,"date":"2012-11-05T14:14:06","date_gmt":"2012-11-05T22:14:06","guid":{"rendered":"http:\/\/blog.mozilla.org\/addons\/?p=5601"},"modified":"2012-11-05T14:14:06","modified_gmt":"2012-11-05T22:14:06","slug":"sdk-private-browsing-api-deprecation","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/","title":{"rendered":"SDK private-browsing API deprecation"},"content":{"rendered":"<p>If you&#8217;ve looked through the documentation for Add-on SDK 1.11, you may have noticed that the page documenting the private-browsing module contains the following message:<\/p>\n<blockquote><p>\nThe activate and deactivate methods are now deprecated. They will continue to work until version 1.13 of the SDK. From version 1.13 onwards they will still exist but will have no effect when called.\n<\/p><\/blockquote>\n<p>While the Jetpack project has often in the past declared a goal of maintaining forward-compatibility of high-level apis. I feel strongly that we should whenever possible maintain api compatibility so that add-on developers can depend on the SDK&#8217;s apis to work even as months go by and any number of new Firefox versions are released into the wilds of the web.<\/p>\n<p>Sometimes the issue of backwards compatibility is out of our hands and changes to Firefox necessitate that we change high-level apis in the SDFK in order to keep pace. The current work on implementing per-window private browsing in Firefox is just such an issue, and as such we&#8217;ve taken steps in the recently released SDK 1.11 to print deprecation warnings for the <a target=\"_blank\" href=\"https:\/\/addons.mozilla.org\/en-US\/developers\/docs\/sdk\/latest\/packages\/addon-kit\/private-browsing.html#Functions\">&#8216;activate&#8217; and &#8216;deactivate&#8217; methods<\/a> in the SDK&#8217;s private-browsing module to the error log.<\/p>\n<p>For the time being these methods will continue to work, but per-window private browsing ( PWPB for short ) is a new set to debut in Firefox 20 (or so) that fundamentally changes how Firefox behaves. The new implementation breaks the assumptions that the SDK&#8217;s private browsing module makes about what is possible, so we have taken steps to deprecate parts of this module. To be specific, the &#8216;activate&#8217; and &#8216;deactivate&#8217; methods in the private-browsing module now produce deprecation warnings:<\/p>\n<pre lang=\"bash\">Timestamp: 2012-11-05 1:39:42 PM\r\nError: pb-deprecation-example: DEPRECATED: require(\"private-browsing\").activate \r\nand require(\"private-browsing\").deactivate is deprecated.<\/pre>\n<p>Here&#8217;s an example of code that will trigger this behaviour:<\/p>\n<pre lang=\"javascript\">var pb = require(\"private-browsing\");\r\n\r\nrequire(\"widget\").Widget({\r\n    id: 'pb-foo',\r\n\tlabel: 'PB, TOGGLE!',\r\n\tcontentURL: 'http:\/\/www.mozilla.org\/favicon.ico',\r\n\tonClick: function() {\r\n        if (pb.isActive) {\r\n            pb.deactivate();\r\n        }\r\n        else {\r\n            pb.activate();   \r\n        }\r\n\t}\r\n});<\/pre>\n<p>To easily try this out, please see <a target=\"_blank\" href=\"https:\/\/builder.addons.mozilla.org\/package\/160251\/latest\/\">this builder example<\/a>.<\/p>\n<p>We expect to ship per-window private browsing in Firefox 20, and once Firefox no longer supports the old private browsing mode any calls to the deprecated methods in the private-browsing module will have no effect. If your add-on uses these apis, you should look instead at <a target=\"_blank\" href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=808747\">bug 808747<\/a> which will track how we support per-window private browsing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve looked through the documentation for Add-on SDK 1.11, you may have noticed that the page documenting the private-browsing module contains the following message: The activate and deactivate methods &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/\">Read more<\/a><\/p>\n","protected":false},"author":316,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[388,44,121,588,742],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SDK private-browsing API deprecation - 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\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Griffiths\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/\",\"name\":\"SDK private-browsing API deprecation - Mozilla Add-ons Community Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\"},\"datePublished\":\"2012-11-05T22:14:06+00:00\",\"dateModified\":\"2012-11-05T22:14:06+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/e2f4c71eb45392ea29162432c3f1d433\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/addons\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SDK private-browsing API deprecation\"}]},{\"@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\/e2f4c71eb45392ea29162432c3f1d433\",\"name\":\"Jeff Griffiths\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b07ae75dd1a5414bf30d7f773ccfc894?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b07ae75dd1a5414bf30d7f773ccfc894?s=96&d=mm&r=g\",\"caption\":\"Jeff Griffiths\"},\"description\":\"Jeff is Product Manager for the Firefox Developer Tools and occasional Open Web hacker, based in Vancouver, BC.\",\"sameAs\":[\"http:\/\/canuckistani.ca\/\",\"https:\/\/x.com\/canuckistani\"],\"url\":\"https:\/\/blog.mozilla.org\/addons\/author\/jgriffithsmozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SDK private-browsing API deprecation - 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\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/","twitter_misc":{"Written by":"Jeff Griffiths","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/","url":"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/","name":"SDK private-browsing API deprecation - Mozilla Add-ons Community Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/addons\/#website"},"datePublished":"2012-11-05T22:14:06+00:00","dateModified":"2012-11-05T22:14:06+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/e2f4c71eb45392ea29162432c3f1d433"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/addons\/2012\/11\/05\/sdk-private-browsing-api-deprecation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/addons\/"},{"@type":"ListItem","position":2,"name":"SDK private-browsing API deprecation"}]},{"@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\/e2f4c71eb45392ea29162432c3f1d433","name":"Jeff Griffiths","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b07ae75dd1a5414bf30d7f773ccfc894?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b07ae75dd1a5414bf30d7f773ccfc894?s=96&d=mm&r=g","caption":"Jeff Griffiths"},"description":"Jeff is Product Manager for the Firefox Developer Tools and occasional Open Web hacker, based in Vancouver, BC.","sameAs":["http:\/\/canuckistani.ca\/","https:\/\/x.com\/canuckistani"],"url":"https:\/\/blog.mozilla.org\/addons\/author\/jgriffithsmozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/5601"}],"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\/316"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/comments?post=5601"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/5601\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media?parent=5601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/categories?post=5601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/tags?post=5601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}