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

add googel chrome dev #31

Closed
chenyulun opened this issue Sep 17, 2021 · 2 comments
Closed

add googel chrome dev #31

chenyulun opened this issue Sep 17, 2021 · 2 comments

Comments

@chenyulun
Copy link

Canary recently crashed and is using Google Chrome Dev,
However, better-OPn does not support the Dev version

@chenyulun
Copy link
Author

  if (shouldTryOpenChromiumWithAppleScript) {
    // Will use the first open browser found from list
-    var supportedChromiumBrowsers = ['Google Chrome Canary', 'Google Chrome', 'Microsoft Edge', 'Brave Browser', 'Vivaldi', 'Chromium'];
+    var supportedChromiumBrowsers = ['Google Chrome Canary', 'Google Chrome Dev', 'Google Chrome', 'Microsoft Edge', 'Brave Browser', 'Vivaldi', 'Chromium'];

    for (var chromiumBrowser of supportedChromiumBrowsers) {
      try {
        // Try our best to reuse existing tab
        // on OSX Chromium-based browser with AppleScript
        execSync('ps cax | grep "' + chromiumBrowser + '"');
        execSync("osascript ../openChrome.applescript \"".concat(encodeURI(url), "\" ").concat(process.env.OPEN_MATCH_HOST_ONLY === 'true' ? encodeURI(normalizeURLToMatch(url)) : encodeURI(url), " \"").concat(chromiumBrowser, "\""), {
          cwd: __dirname,
          stdio: 'ignore'
        });
        return Promise.resolve(true); // eslint-disable-next-line no-unused-vars
      } catch (error) {// Ignore errors.
        // It it breaks, it will fallback to `opn` anyway
      }
    }
  } // Another special case: on OS X, check if BROWSER has been set to "open".
  // In this case, instead of passing `open` to `opn` (which won't work),
  // just ignore it (thus ensuring the intended behavior, i.e. opening the system browser):
  // https://github.com/facebook/create-react-app/pull/1690#issuecomment-283518768

@michaellzc
Copy link
Owner

Hey, thanks for reaching out. Would you open a PR to add support for Google Chrome Dev?

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

2 participants