MCPcopy
hub / github.com/serverless/serverless / openBrowser

Function openBrowser

packages/serverless/lib/utils/open-browser.js:5–21  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

3import { log, style } from '@serverless/util'
4
5export default function openBrowser(url) {
6 log.notice()
7 log.notice(
8 style.aside(
9 `If your browser does not open automatically, please open this URL: ${url}`,
10 ),
11 )
12 log.notice()
13 let browser = process.env.BROWSER
14 if (browser === 'none' || isDockerContainer()) return
15 if (process.platform === 'darwin' && browser === 'open') browser = undefined
16 open(url).then((subprocess) =>
17 subprocess.on('error', (err) => {
18 log.info(`Opening of browser window errored with ${err.stack}`)
19 }),
20 )
21}

Callers

nothing calls this directly

Calls 3

asideMethod · 0.80
noticeMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…