sindresorhus/opn

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Browser tab opens, but does not focus or come to front #325

broofa posted onGitHub

As the title says, I have a minimal use case shown below. When I run this script, it opens a browser tab, but fails to bring Chrome to the front or give it focus.

Passing {background:false} for options does not change this behavior.

'Feels like I'm missing something obvious... 😕

import open from 'open';
open('https://npmgraph.js.org/');

CleanShot 2023-10-23 at 07 14 29


$ envinfo

  System:
    OS: macOS 13.4
    CPU: (10) arm64 Apple M1 Max
    Memory: 10.56 GB / 64.00 GB
    Shell: 5.2.15 - /opt/homebrew/bin/bash
  Binaries:
    Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.20.2/bin/yarn
    npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
    Watchman: 2023.10.09.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 118.0.5993.88
    Firefox: 118.0.2
    Safari: 16.5
  npmPackages:
    @types/node: 20.5.9 => 20.5.9
    @typescript-eslint/eslint-plugin: 6.6.0 => 6.6.0
    @typescript-eslint/parser: 6.6.0 => 6.6.0
    chalk: 5.3.0 => 5.3.0
    commander: 11.1.0 => 11.1.0
    open: 9.1.0 => 9.1.0
    prettier: 3.0.3 => 3.0.3
    standard-version: 9.5.0 => 9.5.0
    typescript: 5.2.2 => 5.2.2

@broofa did you find out how to solve it? Thanks!

posted by jaime-rivas 3 months ago

@jaime-rivas: Nope, to my knowledge this is still an issue, but I haven't tried it since filing this bug. (Have been working on other projects.)

posted by broofa 3 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests