MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / getVncUrl

Function getVncUrl

javascript/grid-ui/src/components/Node/Node.tsx:56–76  ·  view source on GitHub ↗
(session, origin)

Source from the content-addressed store, hash-verified

54}))
55
56function getVncUrl(session, origin) {
57 try {
58 const parsed = JSON.parse(session.capabilities)
59 let vnc = parsed['se:vnc'] ?? ''
60 if (vnc.length > 0) {
61 try {
62 const url = new URL(origin)
63 const vncUrl = new URL(vnc)
64 url.pathname = vncUrl.pathname
65 url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:'
66 return url.href
67 } catch (error) {
68 console.log(error)
69 return ''
70 }
71 }
72 return ''
73 } catch (e) {
74 return ''
75 }
76}
77
78function Node (props) {
79 const { node, sessions = [], origin } = props

Callers 1

NodeFunction · 0.85

Calls 2

logMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected