18

This answer is a thing of beauty. I want to share it far and wide, but I can't figure out how to link directly to the snippet in full screen mode. The helpful "Expand Snippet" button is great and pretty much exactly what I want, but it doesn't put a direct URL in the address bar.

Is it possible to link directly to a running code snippet, preferably in full screen or a stand-alone editor like https://codepen.io/pen/ or https://jsfiddle.net/?

4
  • You can create a codepen/jsfiddle and link to it, but there's no way to set a snippet to open in fullscreen
    – pfg
    Commented Oct 24, 2017 at 18:38
  • 5
    This is by no means a dealbreaker for this feature request, but I would suggest that if the Stack Exchange team chooses to support this, it should open the full-page snippet in a domain other than stackoverflow.com and/or with a more prominent "This is a Stack Snippet!" header, to avoid spoofing the Stack Overflow site itself (e.g., a full-screen snippet that looks exactly like Stack Overflow, on stackoverflow.com, that harvests passwords from unsuspecting users)
    – apsillers
    Commented Oct 26, 2017 at 15:43
  • That is amazing @apsillers, thanks for sharing.
    – Patrick M
    Commented Oct 26, 2017 at 18:32
  • One of the many features suggested as part of the initial feedback here meta.stackoverflow.com/a/271776/2333214
    – T J
    Commented Oct 27, 2017 at 11:40

1 Answer 1

16

Right now, no. There is not even a way to generate a link directly to the snippet either.

The results of a snipped are hosted inside an <iframe>, but there is no fixed url based on any identifiable information.

Clicking the run button just transmits your code to https://stacksnippets.net/js as a POST call.

enter image description here

The service doesn't generate a unique url for your snippet, so you're out of luck unless you want to re-send all of the source code.

5
  • You could use a JavaScript URI to do the post request on a per case basis, and even use compression to reduce the length of the URI, getting people to click such a link would be the hard part.
    – user4639281
    Commented Oct 24, 2017 at 21:28
  • Even if it's a POST?
    – gunr2171
    Commented Oct 24, 2017 at 21:29
  • Yeah, using an AJAX request to post the data. I'm on my phone right now or I would make up a demo. Maybe later.
    – user4639281
    Commented Oct 24, 2017 at 21:30
  • 2
    Just use a URL shortener! Oh wait, then you'll have two problems…
    – Cody Gray Mod
    Commented Oct 25, 2017 at 9:54
  • ... but the bit ain't one
    – GolezTrol
    Commented Oct 26, 2017 at 6:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .