3 ms·
I've always wondered how the site snag.gy does something similar. Take this link, for example (you'll have to disable AdBlock if you want to see the ad): http:/
by achal 14y ago
I've always wondered how the site snag.gy does something similar. Take this link, for example (you'll have to disable AdBlock if you want to see the ad): http://i.snag.gy/0obAy.jpg http://i.snag.gy/0obAy.jpg (ignore the image itself; it was one of the first to pop up in my history)
The source is just the image, and you can embed the image, but there's an ad under the image. Also, right click -> view image or copy image location point to the same URL.
- gwillen 14y agoI suspect that's doing some kind of autodetection to decide which version of the page to serve. (Perhaps based on what MIME type the browser requests.)
- 1880 14y agoYep. In Chrome, pasting the URL in the address bar: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Embedding the URL as a <img> element in a HTML file: Accept:*/*
- sohn8 14y agoDepends on the MIME type the server requests. If your browser requests a html page, it will respond with a html page... and vice versa.
- lifeformed 14y agoI made Snaggy! It's pretty hacky; each browser sends a slightly different header depending on if you're opening the image directly or if you're embedding it. I just have a check for each browser and serve the appropriate page. It doesn't work great on all browsers though (I haven't even tested mobile). I'm going to try to clean it up sometime.
- achal 14y agoHey, just wanted to say Snaggy is awesome. I saw your post a long time ago on Reddit, and you have saved me many seconds in the screenshot process. Not a huge fan of the fact that "View image" doesn't work exactly as I'd expect, but I understand the ads are necessary, so no complaints. Thanks for the awesome site!