4

When I view a post including a Stack Snippet, there is no ability to "run" the snippet like on the website.

On the app:

No Stack Snippets 🙁

On the mobile site:

Stack Snippets and Unicorns 😀

8
  • 1
    Is that even allowed? I always thought Apple doesn't allow running dynamic code, even javascript, unless it is in a web view. – Patrick Hofman Jun 26 '16 at 18:37
  • 1
    @PatrickHofman Isn’t that what a Stack Snippet is — A web view? – J F Jun 26 '16 at 18:51
  • @Pat can't see how this can be true, most basic example is browser app like Chrome which renders JS on iOS just fine. Not sure how easy or feasible it is for an app to render JS, but surely it's possible. Maybe you're confused with Flash, which is indeed not allowed? – Shadow Wizard Wearing Mask V2 Jun 28 '16 at 14:18
  • Nah, I read there is a restriction on executing dynamic code other than in a web view. That is what Chrome uses (they are not allowed to use their own render engine as far as I know for this specific reason). – Patrick Hofman Jun 28 '16 at 14:20
  • @Sha it seems that rule was dropped with iOS 8: arstechnica.com/apple/2016/01/…. – Patrick Hofman Jun 28 '16 at 14:22
  • @Pat huh, never noticed any of this. One never stop learning! :) – Shadow Wizard Wearing Mask V2 Jun 28 '16 at 14:24
  • If the snippet is pure JS, you don't even need a webview to evaluate it. You can use a JSContext in the JavaScriptCore framework. – JAL Jun 28 '16 at 17:41
  • @JAL but a pure JS snippet needs DOM access, too. – J F Jun 28 '16 at 21:09

You must log in to answer this question.

Browse other questions tagged .