code: function permissionJsApis(cb, jsApisConfig, errorCb) {
    if (!jsApisConfig) {
      ship.ready(function () {
        cb(null);
      });
      return;
    }
    ship.ready(function () {
      var permission = ship.apis.runtime.permission;
      var apisConf = jsApisConfig ? jsApisConfig : {};
      var errCb = errorCb ? errorCb : null;
      apisConf.onSuccess = function (response) {
        cb(null, response);
      };
      apisConf.onFail = function (error) {
        if (typeof errCb === 'function') {
          errCb(error);
        } else {
          cb(error, null);
        }
      };
      permission.requestJsApis(apisConf);
    });
  }
docs: Created by xiangwenwen on 2017/3/27.