How to use the web-ext-native-msg.Setup function in web-ext-native-msg

To help you get started, we’ve selected a few web-ext-native-msg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asamuzaK / withExEditorHost / modules / setup.js View on Github external
const runSetup = (cmdOpts = {}) => {
  const {
    browser, configPath, editorArgs, editorPath, overwriteConfig,
    overwriteEditorConfig,
  } = cmdOpts;
  const opt = {
    hostDescription: HOST_DESC,
    hostName: HOST,
    chromeExtensionIds: [EXT_CHROME_ID],
    webExtensionIds: [EXT_WEB_ID],
    callback: handleSetupCallback,
  };
  const setup = new Setup(opt);
  if (isString(browser) && browser.length) {
    setup.browser = browser.trim();
  }
  if (isString(configPath) && configPath.length) {
    setup.configPath = configPath.trim();
  }
  if (overwriteConfig) {
    setup.overwriteConfig = !!overwriteConfig;
  }
  setupOpts.set("editorArgs", editorArgs);
  setupOpts.set("editorPath", editorPath);
  setupOpts.set("overwriteEditorConfig", overwriteEditorConfig);
  return setup.run();
};
github asamuzaK / withExEditorHost / modules / setup.js View on Github external
const runSetup = (cmdOpts = {}) => {
  const {
    browser, configPath, editorArgs, editorPath, overwriteConfig,
    overwriteEditorConfig,
  } = cmdOpts;
  const opt = {
    hostDescription: HOST_DESC,
    hostName: HOST,
    chromeExtensionIds: [EXT_CHROME_ID],
    webExtensionIds: [EXT_WEB_ID],
    callback: handleSetupCallback,
  };
  const setup = new Setup(opt);
  if (isString(browser) && browser.length) {
    setup.browser = browser.trim();
  } else {
    const excludedBrowsers = ["thunderbird"];
    setup.supportedBrowsers = setup.supportedBrowsers.filter(item =>
      !excludedBrowsers.includes(item.toLowerCase()),
    );
  }
  if (isString(configPath) && configPath.length) {
    setup.configPath = configPath.trim();
  }
  if (overwriteConfig) {
    setup.overwriteConfig = !!overwriteConfig;
  }
  setupOpts.set("editorArgs", editorArgs);
  setupOpts.set("editorPath", editorPath);