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 newScramjetFrame instance.
ScramjetController
required
The
ScramjetController instance that manages this frameHTMLIFrameElement
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 underlyingHTMLIFrameElement being managed.
Example
client
Returns theScramjetClient instance running inside the iframe’s contentWindow.
Returns
TheScramjetClient instance for the iframe’s context.
Example
url
Returns the proxified URL as aURL 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