The Open Launch Protocol
What is Open Launch Protocol (OLP)?
OLP is a method to open local applications but also carrying some data in the process. Unlike the EventBusWorker, OLP can launch an application from a file ID and transmit data to it.
But even though OLP can launch any app, it doesn't mean that all apps will respond to the given information. OLP needs receiver side listeners for it to work.
With OLP, you can make 'Open file' popups or even create an app that runs a custom file extension! The possibilities are pretty much endless!
OLP, relies on cross-origin communication based on window.postMessage
API and the "message" event listener.
Using OLP
ntx.olp.launch(appid, data);
appid
is the ID of the application to launchdata
can be anything you need to transmit.
Using OLP as a trigger
To interpret OLP requests and return data to requesters, apps need to have the following method in their source file:
async function greenflag() {
if (myWindow.params) {
// interpret the data
sessionReqID = myWindow.params.trid;
}
}
We also require apps to save the sessionReqID (myWindow.params.trid
) as it is required to return any Data. You can ignore it if the app handler doesnt return anything.
Returning OLP requests
window.parent.OLPreturn(data, sessionReqID)
sessionReqID
is the requestor window UID we saved when the application got triggered of OLP.
The OLP return function can be used anywhere in your application, allowing time-intensive operations to get carried out.
Last updated
Was this helpful?