Rotonde / rotonde-client

Rotonde Base Client
https://client-neauoire.hashbase.io/
MIT License
227 stars 49 forks source link

Feature request: Sandboxed iframe media #100

Open 0x0ade opened 7 years ago

0x0ade commented 7 years ago

It'd be great to see support for custom .html embeds in sandboxed iframes. It'd enable interactive media (f.e. PICO-8 games) to be shared more easily.

They shouldn't "autoplay" - the user should either activate the embed first, or have the chance to open it in a new tab / new window.

For metadata (f.e. title, frame size), an .embed.json could be left next to the embedded page (or must be linked as the actual media).

An example with support restricted to a whitelist is Discord:

image

eelfroth commented 7 years ago

I would love to be able to embed txt and md. html sounds scary though…

0x0ade commented 7 years ago

htmls are quite scary, but they should be no risk with the sandbox flag set for the iframe.

Wouldn't embedded mds require a markdown compiler / parser, though?

eelfroth commented 7 years ago

yeah maybe, not sure. Beaker can render md if you open it as a page, so perhaps this can be made to work in an iframe too (I tried but sadly that's not the default behaviour)

0x0ade commented 7 years ago

I peeked into Beaker to see how it parses / renders markdown.

Whenever a new page is opened and it's a markdown page, it injects markdown-renderer.js:

https://github.com/beakerbrowser/beaker/blob/760b90f2f265ab612d6596a0c63529a2a2101819/app/shell-window/pages.js#L649-L676

markdown-renderer.js itself uses the Remarkable parser:

https://github.com/beakerbrowser/beaker/blob/760b90f2f265ab612d6596a0c63529a2a2101819/app/markdown-renderer.js#L3-L5

I guess Electron apps could deal with newly created iframes with the help of a preloaded helper + MutationObserver, but for now, we'd need to deal with markdown content on our own.

pfrazee commented 7 years ago

I'll look into whether Beaker can solve that issue with iframes.

On Sun, Nov 19, 2017 at 4:31 PM, Maik Macho notifications@github.com wrote:

I peeked into Beaker to see how it parses / renders markdown.

Whenever a new page is opened and it's a markdown page, it injects markdown-renderer.js:

https://github.com/beakerbrowser/beaker/blob/ 760b90f2f265ab612d6596a0c63529a2a2101819/app/shell-window/ pages.js#L649-L676

markdown-renderer.js itself uses the Remarkable parser:

https://github.com/beakerbrowser/beaker/blob/ 760b90f2f265ab612d6596a0c63529a2a2101819/app/markdown-renderer.js#L3-L5

I guess Electron apps could deal with newly created iframes with the help of a preloaded helper + MutationObserver, but for now, we'd need to deal with markdown content on our own.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Rotonde/rotonde-client/issues/100#issuecomment-345555575, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNhU8rFauE7yPhjPASO1ZHVLX9JMGxCks5s4KwogaJpZM4QTi3O .

neauoire commented 6 years ago

@0x0ade We've had them for a little while now, is this issue still valid?

0x0ade commented 6 years ago

IMO the issue is still valid for two reasons: