Brief Introduction
How Do Plugins Operate
First, let's take a look at the operational mechanisms associated with plug-ins so as to better take use of them.
Pixso plug-ins are essentially the same as developing other websites, which require HTML, CSS, JavaScript, and other Web technologies. However, for the security of the plug-ins and the platform, we have adjusted and restricted certain browser APIs and their usage to our rules.
Access Pixso Files
If your plug-in needs to access Pixso files, you can do it by writing a JavaScript script. Also for security reasons, the JavaScript script runs in the main thread sandbox, which is a small JavaScript runtime environment. Therefore, browser-provided APIs such as XMLHttpRequest
and DOM
cannot be accessed in the sandbox. However, you can use standard JavaScript ES libraries like JSON
, the Promise
API, and Unit8Array
.
Build User Interface
You can build the user interface via the HTML file. The user interface runs in <iframe>
and is essentially a separate page. All Web APIs can be accessed via JavaScript, but Pixso's plug-in APIs are not directly accessible.
Transfer Information Between the Main Thread Script and Users
If you need to access all Web APIs and Pixso files at the same time, you can combine the two approaches above to achieve information communication between scripts of the user interface and that in the sandbox.