+
Skip to content

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

@syoichi

Description

@syoichi

現在の実装だと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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载