Usage

The Spect browser API is built for interviewer sites that want to run interviews fairly. It provides full window blocking, satellite phone streams, display and process inspection, and more. Everything is available on window.Spect.

Local ports

Spect runs two internal servers: port 8888 for signaling and port 1935 for RTMP. Make sure nothing else is using those ports while the Spect browser is running, or the API will conflict.

Blocking Window API

Blocks the whole window. While blocking is active, the candidate cannot switch tabs with Ctrl+Tab or switch applications with Alt+Tab, and most other keyboard shortcuts are suppressed too. It also pushes back floating windows, such as AI cheating assistants.

ts
await window.Spect.blockwindow()

// { success: true, blockMode: true }
Read the Session Mode breakdown

Unblocking Window API

Releases the window after blocking has been applied.

ts
await window.Spect.unblockwindow()

// { success: true, blockMode: false }

isBlocked API

Returns whether the window is currently blocked. Use it to check the live state of the lockdown.

ts
const blocked = await window.Spect.isBlocked()

// false

Satellite APIs

Satellite lets the candidate scan a QR code shown by the Spect browser with the Spect Satellite app. The QR code contains the local IP and port, and after connecting the candidate can share live video from their phone camera with the browser.

openQRCodeModal()

Opens the QR code modal.

ts
await window.Spect.satellite.openQRCodeModal()

closeQRCodeModal()

Closes the QR code modal once the candidate has scanned it.

ts
await window.Spect.satellite.closeQRCodeModal()

getLiveStream()

Returns the ID of the live video element for the stream coming from the phone.

ts
const videoId = await window.Spect.satellite.getLiveStream()

const video = document.getElementById(videoId)
const stream = video.captureStream()

console.log(stream.getVideoTracks())

Multiple Monitor Detection API

Returns the number of external monitors connected, excluding the primary display.

ts
const externalDisplays = await window.Spect.getExternalDisplayCount()

// 1

Hidden Process API

Returns all hidden processes running on the machine as an array.

ts
const hiddenProcesses = await window.Spect.getHiddenProcesses()

// (3) [{…}, {…}, {…}]