ScramjetFrame class provides an abstraction over proxy iframe creation, allowing you to manage isolated browsing contexts without worrying about proxy internals.
Creating a frame
Frames are created using thecreateFrame() method on your ScramjetController instance:
Navigation methods
TheScramjetFrame class provides several methods for controlling navigation within the isolated context:
Navigate to a URL
Use thego() method to navigate to a new URL:
Browser history navigation
Accessing frame properties
TheScramjetFrame instance provides access to useful properties:
Current URL
Get the current proxified URL:ScramjetClient instance
Access theScramjetClient instance running inside the iframe:
The
client property gives you access to the Scramjet instance running within the iframe’s context, allowing for advanced manipulation if needed.Raw iframe element
Access the underlying HTMLIFrameElement:Building a browser interface
Here’s a complete example of building a simple browser interface with navigation controls:Multiple frames
You can create and manage multiple frames simultaneously:Advanced usage
Detecting when context is ready
Listen for thecontextInit event to know when the frame has fully initialized:
Styling frames
Style the iframe element to fit your application:Frame cleanup
When you’re done with a frame, remove it from the DOM:Related guides
Event handling
Learn how to handle navigation, URL changes, and download events
Cookie management
Manage cookies within isolated frame contexts