{"id":1228,"date":"2013-09-18T00:43:55","date_gmt":"2013-09-17T15:43:55","guid":{"rendered":"http:\/\/kazu.tv\/blog\/?p=1228"},"modified":"2013-09-18T00:49:22","modified_gmt":"2013-09-17T15:49:22","slug":"%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91firefox%e6%8b%a1%e5%bc%b5%e3%81%ae%e4%bd%9c%e6%88%90add-on-sdk%e3%82%92%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/kazu.tv\/blog\/2013\/09\/18\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91firefox%e6%8b%a1%e5%bc%b5%e3%81%ae%e4%bd%9c%e6%88%90add-on-sdk%e3%82%92%e4%bd%bf%e7%94%a8\/","title":{"rendered":"\u521d\u5fc3\u8005\u5411\u3051Firefox\u62e1\u5f35\u306e\u4f5c\u6210(Add-on SDK\u3092\u4f7f\u7528)"},"content":{"rendered":"<p>Firefox\u62e1\u5f35(extension)\u306e\u4f5c\u308a\u65b9\u306f\u5927\u304d\u304f\u5206\u3051\u30663\u901a\u308a\u3002\u8a73\u3057\u304f\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u7167\u3002<\/p>\n<p><a title=\"Firefox \u62e1\u5f35\u306e\u4f5c\u308a\u65b9 (2013 \u5e74\u7248) - \u3072\u3060\u307e\u308a\u30bd\u30b1\u30c3\u30c8\u306f\u58ca\u308c\u306a\u3044\" href=\"http:\/\/vividcode.hatenablog.com\/entry\/how-to-develop-firefox-extension\" target=\"_blank\">Firefox \u62e1\u5f35\u306e\u4f5c\u308a\u65b9 (2013 \u5e74\u7248)<\/a><\/p>\n<p>\u4eca\u56de\u306f\u3001\u4e00\u756a\u521d\u5fc3\u8005\u5411\u3051\u3068\u3055\u308c\u308bAdd-on SDK\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a18\u8ff0\u3059\u308b\u3002\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f<a href=\"https:\/\/addons.mozilla.org\/en-us\/developers\/builder\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u306e\u30b5\u30a4\u30c8\u306e\u5de6\u4e0a\u306b\u3042\u308b\u300cDocumentation\u300d\u306e\u30ea\u30f3\u30af\u304b\u3089\u9069\u5f53\u306b\u305f\u3069\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u958b\u767a\u74b0\u5883\u306e\u6574\u5099<\/h2>\n<p>\u307e\u305a\u306f\u958b\u767a\u74b0\u5883\u3092\u6574\u5099\u3059\u308b\u3002<\/p>\n<h3>SDK\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p><a href=\"https:\/\/addons.mozilla.org\/en-us\/developers\/builder\" target=\"_blank\">\u3053\u3053<\/a>\u304b\u3089Add-on SDK\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002Add-on Builder\u3068\u3044\u3046\u306e\u306f\u7121\u8996\u3059\u308b\u3002<\/p>\n<h3>Firefox\u3067\u958b\u767a\u7528\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/h3>\n<p>Firefox\u306b\u306f\u300c\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308b\u3002\u901a\u5e38\u306e\u74b0\u5883\u3068\u306f\u5225\u306b\u3001Extension\u958b\u767a\u7528\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3002\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306b\u95a2\u3057\u3066\u306f\u3001\u8a73\u3057\u304f\u306f<a href=\"https:\/\/support.mozilla.org\/en-US\/kb\/profiles-where-firefox-stores-user-data\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u3092\u53c2\u7167\u3002<\/p>\n<p>Mac\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u69d8\u306b\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002dev\u3068\u3044\u3046\u306e\u304c\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u540d\u3002\u74b0\u5883\u306b\u3088\u3063\u3066\u82e5\u5e72\u7570\u306a\u308b\u306e\u3067\u3001\u8a73\u3057\u304f\u306f<a href=\"https:\/\/support.mozilla.org\/ja\/kb\/profile-manager-create-and-remove-firefox-profiles#w_cucgciaaacceagluna\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u3092\u3002<\/p>\n<pre class=\"brush: plain;\">\/Applications\/Firefox.app\/Contents\/MacOS\/firefox-bin -no-remote -P dev &amp;<\/pre>\n<p>Mac\u306e\u5834\u5408\u3001\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u5834\u6240\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001ls\u3067\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30eb\u30c0\u540d\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304f\u3002<\/p>\n<pre class=\"brush: plain;\">~\/Library\/Application Support\/Firefox\/Profiles\/<\/pre>\n<h3>Firefox\u306e\u74b0\u5883\u8a2d\u5b9a<\/h3>\n<p>\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3067Firefox\u3092\u8d77\u52d5\u3059\u308b\u306b\u306f\u3001Mac\u306e\u5834\u5408\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5b9f\u884c\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain;\">\/Applications\/Firefox.app\/Contents\/MacOS\/firefox-bin -no-remote -p &amp;<\/pre>\n<p>\u305d\u306e\u3046\u3048\u3067\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u958b\u767a\u74b0\u5883\u3092\u6574\u3048\u3066\u304a\u304f\u3068\u3088\u3044\u3002<\/p>\n<ul>\n<li>Firebug\u3084\u305d\u306e\u4ed6\u958b\u767a\u30c4\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n<li>(\u5fc5\u305a\u3057\u3082\u3053\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3084\u308b\u5fc5\u8981\u306f\u306a\u3044\u304c)\u95a2\u9023\u30b5\u30a4\u30c8\u3078\u306e\u30ed\u30b0\u30a4\u30f3\u3002\u4f8b\u3048\u3070Evernote\u95a2\u9023\u306eExtension\u3092\u958b\u767a\u3059\u308b\u306e\u3067\u3042\u308c\u3070\u3001Evernote\u3078\u4e8b\u524d\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304a\u304f\u3002<\/li>\n<\/ul>\n<h2>Firefox\u62e1\u5f35\u306e\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f<\/h2>\n<p>Chrome\u306e\u30d6\u30e9\u30a6\u30b6\u62e1\u5f35\u3068\u4ed5\u7d44\u307f\u306f\u5c11\u3057\u4f3c\u3066\u3044\u308b\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u62e1\u5f35\u306e\u69cb\u6210\u8981\u7d20\u3068\u3057\u3066\u306f\u3001\u4e3b\u306b\u4ee5\u4e0b\u306e2\u3064\u306b\u5206\u304b\u308c\u308b\u3002<\/p>\n<ul>\n<li>add-on code<\/li>\n<li>content scripts<\/li>\n<\/ul>\n<p>&#8220;content scripts&#8221;\u306f\u3001\u540d\u524d\u306fChrome Extension\u306e\u3082\u306e\u3068\u540c\u3058\u3060\u304c\u3001\u8003\u3048\u65b9\u304c\u5c11\u3057\u9055\u3046\u3068\u601d\u3046\u3002<\/p>\n<p>add-on code\u3068\u5404content script\u3068\u306f\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u901a\u4fe1\u3067\u30c7\u30fc\u30bf\u306e\u3084\u308a\u3068\u308a\u3092\u884c\u3046\u3002<a href=\"https:\/\/addons.mozilla.org\/en-US\/developers\/docs\/sdk\/latest\/dev-guide\/guides\/content-scripts\/index.html\" target=\"_blank\">\u3053\u306e\u30da\u30fc\u30b8<\/a>\u306e\u56f3\u304c\u7c21\u6f54\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u3068\u601d\u3046\u3002<\/p>\n<h2>\u57fa\u672c\u7684\u306a\u4f5c\u308a\u65b9<\/h2>\n<p>\u3053\u3061\u3089\u306e<a href=\"https:\/\/addons.mozilla.org\/en-US\/developers\/docs\/sdk\/latest\/dev-guide\/tutorials\/getting-started-with-cfx.html\" target=\"_blank\">\u30da\u30fc\u30b8<\/a>\u901a\u308a\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3002<\/p>\n<pre class=\"brush: plain;\">mkdir my-addon\r\ncd my-addon\r\ncfx init<\/pre>\n<p>\u3053\u308c\u3067\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3068\u304b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u8272\u3005\u4f5c\u6210\u3055\u308c\u308b\u3002\u305d\u306e\u5f8c\u3001<\/p>\n<pre class=\"brush: plain;\">cfx run<\/pre>\n<p>\u3092\u4e00\u5ea6\u5b9f\u884c\u3059\u308b\u3068\u3001Extension\u306eID\u304c\u751f\u6210\u3055\u308c\u3001pacakge.json \u306e\u4e2d\u306b\u66f8\u304d\u8fbc\u307e\u308c\u308b\u3002\u305d\u306e\u5f8c\u3082\u3046\u4e00\u5ea6cfx run\u3092\u5b9f\u884c\u3059\u308b\u3068Extension\u304c\u5165\u3063\u305fFirefox\u304c\u8d77\u52d5\u3055\u308c\u308b\u3002<\/p>\n<h2>\u30c7\u30d0\u30c3\u30b0\u306e\u4ed5\u65b9<\/h2>\n<p>\u3061\u306a\u307f\u306b\u3001\u5358\u7d14\u306b`cfx run`\u3092\u5b9f\u884c\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u4e0a\u306e\u65b9\u3067\u8a2d\u5b9a\u3057\u305f\u3088\u3046\u306a(\u958b\u767a\u30c4\u30fc\u30eb\u3068\u304b\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f)\u72b6\u614b\u3067Firefox\u304c\u8d77\u52d5\u3059\u308b\u306e\u3067\u3001\u8272\u3005\u3068\u4fbf\u5229\u3002<\/p>\n<pre class=\"brush: plain;\">cfx run --profiledir=~\/Library\/Application\\ Support\/Firefox\/Profiles\/xxxxxx.dev\/<\/pre>\n<p>\u5f8c\u306f\u3001console.log \u3068\u304b\u51fa\u3057\u3066\u3082\u3044\u3044\u3057\u3001Firebug\u3068\u304b\u6d3b\u7528\u3057\u3066\u9069\u5f53\u306b\u3002<\/p>\n<h2>\u5177\u4f53\u7684\u306a\u958b\u767a\u306etips\u3068\u304b<\/h2>\n<h3>\u30c4\u30fc\u30eb\u30d0\u30fc\u30dc\u30bf\u30f3<\/h3>\n<p>SDK\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u304b\u3084\u308b\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u53f3\u4e0b(\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc)\u306e\u8fba\u308a\u306b\u30dc\u30bf\u30f3\u3092\u51fa\u3059\u65b9\u6cd5\u306f\u3042\u308b\u304c\u3001Firebug\u306a\u3069\u306e\u3088\u3046\u306b\u30a2\u30c9\u30ec\u30b9\u30d0\u30fc\u306e\u53f3\u306e\u65b9\u306b\u30dc\u30bf\u30f3\u3092\u51fa\u529b\u3059\u308b\u65b9\u6cd5\u306f\u4f55\u3082\u89e6\u308c\u3089\u308c\u3066\u3044\u306a\u3044\u3002<\/p>\n<p>\u8272\u3005\u8abf\u3079\u305f\u3051\u3069\u3001\u4e00\u756a\u7c21\u5358\u305d\u3046\u306a\u306e\u306fErik Vold\u3068\u3044\u3046\u4eba\u304c\u4f5c\u3063\u305f&#8221;toolbarbutton&#8221;\u3068\u3044\u3046\u306e\u3092\u4f7f\u3046\u65b9\u6cd5\u3089\u3057\u3044\u3093\u3060\u3051\u3069\u3001\u4ee5\u4e0b\u306eURL\u306f404\u3068\u306a\u3063\u3066\u3044\u3066\u3069\u3053\u3067\u5165\u624b\u3057\u3066\u3044\u3044\u306e\u304b\u826f\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>https:\/\/github.com\/voldsoftware\/toolbarbutton-jplib<\/p>\n<p>\u7d50\u5c40\u3001\u4ee5\u4e0b\u306e<a href=\" http:\/\/stackoverflow.com\/questions\/18399155\/dynamically-change-the-image-of-toolbarbutton-using-erik-volds-toolbarbutto\" target=\"_blank\">SO\u306e\u30b9\u30ec\u30c3\u30c9<\/a>\u306b\u56de\u7b54\u3057\u3066\u3044\u308b\u4eba\u304cfork\u3057\u305fToolbar Button Complete\u3068\u3044\u3046\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<h3>Ajax<\/h3>\n<p>\u7d50\u8ad6\u304b\u3089\u5148\u306b\u66f8\u304f\u3068\u3001content script\u304b\u3089\u306f(\u5b9f\u8cea)Ajax\u306f\u4f7f\u3048\u306a\u3044\u3002\u5916\u90e8\u3068\u901a\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u6709\u308b\u5834\u5408\u306f\u3001add-on\u672c\u4f53(main.js)\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6295\u3052\u3066\u3001main.js\u304cAjax\u3092\u884c\u3044\u3001\u7d50\u679c\u304c\u5e30\u3063\u3066\u304d\u305f\u3089content script\u306b\u5bfe\u3057\u3066\u518d\u5ea6\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6295\u3052\u308b\u3068\u3044\u3046\u65b9\u6cd5\u304c\u826f\u3044\u3002<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Add-on SDK\u3092\u4f7f\u3046\u3068\u6bd4\u8f03\u7684\u7c21\u5358\u306bFirefox\u306eExtension\u304c\u4f7f\u3048\u308b\u3002\u305f\u3060\u3001\u305d\u308c\u3067\u3082Chrome\u306b\u6bd4\u3079\u308b\u3068\u8272\u3005\u5236\u7d04\u304c\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Firefox\u62e1\u5f35(extension)\u306e\u4f5c\u308a\u65b9\u306f\u5927\u304d\u304f\u5206\u3051\u30663\u901a\u308a\u3002\u8a73\u3057\u304f\u306f\u4ee5\u4e0b\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u7167\u3002 Firefox \u62e1\u5f35\u306e\u4f5c\u308a\u65b9 (2013 \u5e74\u7248) \u4eca\u56de\u306f\u3001\u4e00\u756a\u521d\u5fc3\u8005\u5411\u3051\u3068\u3055\u308c\u308bAdd-on SDK\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1228","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/comments?post=1228"}],"version-history":[{"count":5,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1228\/revisions"}],"predecessor-version":[{"id":1233,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/posts\/1228\/revisions\/1233"}],"wp:attachment":[{"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/media?parent=1228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/categories?post=1228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kazu.tv\/blog\/wp-json\/wp\/v2\/tags?post=1228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}