Creating New Window
Creating Window in Java
Create Window
To create new window, or modify the web content of the ones that are already created, you may use the WindowManager API.
Then, you can create a new window like this:
WindowManager.getInstance()
.createWindow("https://www.equo.dev").build();
The example above will create a new popup window by default. The following example will show the same result:
WindowManager.getInstance()
.createWindow("https://www.equo.dev").popup().build();
The property popup()
will create the browser in a new window.
From now on we will avoid naming the property popup since it comes by default.
|
Also you can create new window with a browserName
like this:
WindowManager.getInstance()
.createWindow("https://www.equo.dev", "Equo").build();
Or you can do the same with the follow property:
WindowManager.getInstance()
.createWindow("https://www.equo.dev").windowName("Equo").build();
Create Frameless Window
This property has another property with. This new property allow to create frameless window. Only in cases having the propoerty popup
with.
WindowManager.getInstance()
.createWindow("https://www.equo.dev", "Equo").frameless().build();
Create Window Inside the Browser
You can create new window inside the own browser at different positions like: top, right, bottom and left
side. In this example we only show you how to create window on the right side, but it is the same way for all sides possibilities mentioned above:
WindowManager.getInstance()
.createWindow("https://www.equo.dev", "Equo").right().build();
It is not possible create frameless windows inside the own browser. |
Update Browser
In a similar way you can update a browser URL with the updateBrowser
method by passing the new URL and the name of the browser to update. If you want to update the main browser, omit the browserName
parameter. Example:
WindowManager.getInstance()
.updateBrowser("https://docs.equo.dev", "Second browser");
Creating Window in JavaScript
It’s also possible to do all this work with JavaScript code. You can opt for the equo-sdk Node package, or to use the global JavaScript Equo API. To import a Node.js package in your application, please review the APIs section.
Examples of using the JavaScript API:
equo.createWindow({
url: "https://www.equo.dev",
name: "Second browser",
position: "popup"
});
equo.updateBrowser({
url: "https://docs.equo.dev",
name: "Second browser"
});
You can also create new browsers inside an existing window. The API accepts a position to allocate the new browser. Possible values for the position parameter are top
, right
, bottom
and left
.
equo.createWindow({
url: "https://www.equo.dev",
name: "Second browser",
position: "right"
});