Skip to main content
The ScramjetFrame class provides an abstraction over proxy iframe creation and management. It handles navigation, event dispatching, and provides access to the proxified context.

Constructor

Creates a new ScramjetFrame instance.
ScramjetController
required
The ScramjetController instance that manages this frame
HTMLIFrameElement
required
The iframe element to be controlled under Scramjet
You typically won’t call this constructor directly. Use ScramjetController.createFrame() instead.

Example

Properties

frame

The underlying HTMLIFrameElement being managed.

Example

client

Returns the ScramjetClient instance running inside the iframe’s contentWindow.

Returns

The ScramjetClient instance for the iframe’s context.

Example

url

Returns the proxified URL as a URL object.

Returns

The current proxified URL.

Example

Methods

go()

Navigates the iframe to a new URL under Scramjet.
string | URL
required
A real URL to navigate to

Example

back()

Goes backwards in the browser history.

Example

forward()

Goes forward in the browser history.

Example

reload()

Reloads the iframe.

Example

addEventListener()

Binds event listeners to listen for proxified navigation events in Scramjet.
'navigate' | 'urlchange' | 'contextInit'
required
Type of event to listen for
Function
required
Event listener callback function
boolean | AddEventListenerOptions
Options for the event listener

Example

Events

Fired when the frame navigates to a new proxified URL.

urlchange

Fired when the proxified URL changes in the frame.

contextInit

Fired when Scramjet initializes in the frame.
See event types for complete event definitions.

Complete example