Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

拡張機能の起動処理を担当するtombfix.jsをよりシンプルにする #206

Open
syoichi opened this issue Dec 26, 2015 · 0 comments

Comments

@syoichi
Copy link
Member

syoichi commented Dec 26, 2015

現在の実装だとtombfix.js内の処理に、component.jsと被っているものやユーティリティー系の関数がいくつかあるので、可能であれば、それらを全て別のファイルに切り出し、tombfix.jsでは起動処理となるTombfixServiceの作成とエクスポートに限定したい。
最終的には、だいたい以下の様な感じにしたいかな。

// core/src/components/components.js
/* global Components */

(function executeComponents(global) {
  'use strict';

  const {utils: Cu} = Components;

  const {Utils} = Cu.import('resource://tombfix/Utils.jsm', {});
  const {Tombfix} = Cu.import('resource://tombfix/Tombfix.jsm', {});

  Utils.exportService(global, function TombfixService() {
    this.init();
  }, {
    classDescription: 'Tombfix\'s JavaScript XPCOM Component',
    contractID: '@tombfix.github.io/tombfix-service;1',
    classID: '{ab5cbd9b-56e1-42e4-8414-2201edb883e7}',

    init() {
      Tombfix.init();
    }
  });
}(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant