sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.71k stars 705 forks source link

Javascript actions/intents should be accessible to apps #1542

Open phildini opened 8 years ago

phildini commented 8 years ago

Hello! here's my use case, which @paulproteus said I should document.

My app lets users add a trello card by clicking a button in the app. This button uses some javascript to launch a trello window, and the user takes it from there.

What I'd like is, in sandstorm, wire that button to some sandstorm-provided api which works like this:

I hear the Powerbox is supposed to solve some of this? Just adding my use case. Hard-wiring to Wekan as an initial version of this would be totally fine for me, but it seems more sandstorm-y to let users choose a corresponding app.

I can think of many more use cases for this kind of thing if it would be helpful to list them.

paulproteus commented 8 years ago

Thanks for filing this, Philip! I think that your use-case here is representative of what a lot of people would want, and so I want to make sure we leave this open until you can tell us that our long complicated powerbox struggle actually achieves what you (as an app author) want.

kentonv commented 8 years ago

FWIW, this use case seems to be a match for the "offer powerbox". Your app would offer() a task object, and the powerbox would allow the user to choose a grain (or an app, to create a new grain) to accept the offer. We don't have this yet, but it's definitely planned.

phildini commented 8 years ago

Is your vision that the offer()ing would happen in capnproto, or js, or...?

kentonv commented 8 years ago

@phildini: Either. There's a Cap'n Proto RPC API on the server, but you'd also be able to postMessage() from client-side JS to the Sandstorm shell.

paulproteus commented 8 years ago

Also, I wonder if http://webintents.org/ is any use to us, and/or if there are existing standards we can build on top of.

UPDATE: It seems that work on WebIntents is stopped for now; see https://paul.kinlan.me/what-happened-to-web-intents/

UPDATE: See also Web Activities https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/API/Web_Activities

kentonv commented 8 years ago

@paulproteus Fun story: Web Intents was proposed many years ago while I was still at Google. But some time before it, Tyler Close and I had put together a proposal we called "Web Powerbox" (later renamed "Web Introducer"). We were working on Web Powerbox as a W3C standard. However, we were not on the Chrome team. The powers that be on the Chrome team were not happy about non-Chrome people engaging the W3C, and they basically shut us out even though some people lower-down the food chain on Chrome (as well as people at Mozilla) were excited about working with us. The leadership argued that no one wanted this Web Powerbox thing, that it was a solution looking for a problem. Later on, "Web Intents" were proposed by someone inside the Chrome team. The same people from Chrome leadership who said Web Powerbox was not needed immediately praised Web Powerbox and put together a team to work on it. The proposal was, however, deeply flawed -- it had many security problems and was less powerful than Web Powerbox. Tyler attempted to point out the flaws (by this time, I had moved on and was not directly involved). The Chrome team humored him by inviting him to a meeting, but decided to ignore his input and let the Web Intents people -- who were Chrome people -- do what they wanted. After a year or two they had failed to produce something that worked and Chrome canceled the project.