Open mateosalta opened 6 years ago
You can do it by adding webapp-creator.url-dispatcher
file with the contents: [{"protocol": "webapp-creator"}]
and adding a hook to manifest.json
file: "hooks": { "webapp-creator": {"urls": "webapp-creator.url-dispatcher"} }
.
Then you can invoke Webapp Creator by URL: webapp-creator://params
and get the params by parsing the URL in QML: var params = Array.prototype.slice.call(Qt.application.arguments).filter(function (a) { return a.match(/^webapp-creator:\/\//); })[0].substring(17);
The image in QML could be serialized as data URI: Image { source: "data:image/png;base64," + imageDataFromURL }
.
if a app wanted to link to webapp creator - https://github.com/ubports/morph-browser/issues/18 we would need to accept a url argument