Web API
Integration Notes
These APIs are only available in the Pixso desktop client. Open the client configuration address, configure the target URL, and then connect to the Pixso desktop client APIs.
During development, configure your own local URL for debugging.
Web API
The web side exposes a built-in Pixso object named pixsoDesktopJSAPI. All APIs are called through this object.
Check whether the current environment is Pixso desktop
js
// Whether the current environment is the Pixso desktop client.
const isPixsoDesktop = window.pixsoDesktopJSAPI;Get the current client version
js
// Get the client version.
const version = pixsoDesktopJSAPI.version;Open a tab
js
// Open a tab.
pixsoDesktopJSAPI.viewPostMessageToMainProcess("openTab", {
url,
title,
isNewTab,
icon_type,
});url: stringRequired. The URL to open in the tab. Example file URL:https://pixso.cn/app/editor/_P0wo93-6euk362Skk421g?showQuickFrame=true&icon_type=1&page-id=0%3A1.title: stringOptional. The title of the new tab.isNewTab: booleanOptional. Defaults totrue. Whether to open a new tab.icon_type: numberOptional. Defaults to-1. Values:-1means no icon,1means design file,2means prototype file, and3means whiteboard file.
Close a tab
js
// Close the current tab.
pixsoDesktopJSAPI.viewPostMessageToMainProcess("closeView");Open the home page
js
// Open the home page.
pixsoDesktopJSAPI.viewPostMessageToMainProcess("showHomepage");