Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept from url, and with argument #41

Open
mateosalta opened this issue Oct 4, 2018 · 1 comment
Open

accept from url, and with argument #41

mateosalta opened this issue Oct 4, 2018 · 1 comment

Comments

@mateosalta
Copy link
Collaborator

if a app wanted to link to webapp creator - ubports/morph-browser#18
we would need to accept a url argument

@niutech
Copy link

niutech commented Jun 11, 2019

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 }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants