4

If you read RSS items on Feed.ly, you have an option to "preview" the item, which opens up the corresponding URL in an iFrame. They have somehow gotten a load bar on top of the frame though, can't figure out how they got access to the load percentage.

enter image description here

If they're faking it, they're doing a fantastic job. Anyone have any idea how to get load progress from an iframe?

Brent
  • 23,354
  • 10
  • 44
  • 49
  • possible duplicate http://stackoverflow.com/questions/10397486/iframes-loading-with-progress-bar-using-jquery – DLeh Feb 05 '15 at 21:06
  • I think that they are faking it, for security reasons you can't manipulate the contain of an iFrame. Imagine if you "can" manipulate the contain of an iFrame, you could include in your website gmail.com, stole the cookie, send emails, etc. – Daniel Aranda Feb 05 '15 at 21:11
  • 1
    @DLeh No. That Q&A are where the two pages are maintained by the same person, and they have control over both. Here, only one page is controlled. – Scimonster Feb 05 '15 at 21:13
  • Yeah, I know how to use the load event to detect when it's done, what I want is some sort of bytesLoaded / bytesTotal access. That's not really content manipulation. – Brent Feb 05 '15 at 21:17

1 Answers1

2

If you couldn't get an actual bytesLoaded and bytesTotal, you could track how long it takes all users to load that iframe and come up with an average loading speed that you then use to govern the progress bar. If you wanted it to be even more accurate, you could track how the current user's loading speeds match up to the average loading speeds on every item they preview (or maybe per feed) and develop an even better approximation based on that user's relative times.

The first few people would just be guesswork but after that, you might be able to get relatively close. Naturally, that approach is going to work better when you have a large number of users, like feedly does. For a smaller site or more niche RSS feeds, it would be less useful.

Edit: I don't think they're actually doing that though. At least, I don't see them making any tracking requests. I think they're probably just faking it. After previewing a lot of items, sometimes the bar is only half way full when it disappears and sometimes it fills in completely before you see more than a white screen. I think it's a placebo.

ZorroDeLaArena
  • 547
  • 6
  • 17
  • [My +1](http://meta.stackoverflow.com/questions/277314/should-we-discourage-leading-1-on-comments) is for the last line. – Scimonster Feb 06 '15 at 13:06