Chrome only allows 1000 iframes
-
I can't find this fact documented by googling, but it certainly seems that after the 1000th iframe on my page, it doesn't bother displaying the rest.
-
@ben_warre I feel like I'm missing the most interesting part of this story.
-
Literally unusable
-
@boomzilla said in Chrome only allows 1000 iframes:
the most interesting part of this story
-
@boomzilla said in Chrome only allows 1000 iframes:
@ben_warre I feel like I'm missing the most interesting part of this story.
It's a page that securely mediates the entirety of www. Duh.
-
@ben_warre Mac Classic had a limit of something like 255 controls per window. The documentation for this said something like, "if you run up against this limit, your design is very wrong and should be revisited."
-
@blakeyrat For some reason that puts me in the mind of:
-
Related to the post about silly SQL databases.
So I now have a local cache database that stores the jobs.
On the website, there's a div for each job.
Clicking the div expands an iframe underneath that loads a page which gets more data from the shitty slow database.
...
-
@ben_warre have you perhaps considered using ajax calls to get the data rather than iframes?
-
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
-
@blakeyrat said in Chrome only allows 1000 iframes:
@ben_warre Mac Classic had a limit of something like 255 controls per window. The documentation for this said something like, "if you run up against this limit, your design is very wrong and should be revisited."
Windows also has such limitations.
This is also why IE draws its own controls (such as radio buttons) instead of offloading this to the window manager: they want to prevent a malintending site from breaking the browser.
-
@alexmedia said in Chrome only allows 1000 iframes:
Windows also has such limitations.
Juan has a good point:
I've always wondered how it were possible that the In Case Of Emergency utility were allowed to fail....
-
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
The iframes don't do anything until you click the div.
-
@ben_warre said in Chrome only allows 1000 iframes:
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
The iframes don't do anything until you click the div.
They don't exist? Or you don't set the src until you click the div? Because AFAIK simply hiding an iframe doesn't stop it from loading its source...
-
@sloosecannon said in Chrome only allows 1000 iframes:
@ben_warre have you perhaps considered using ajax calls to get the data rather than iframes?
Iframes I can do. Ajax I have not played with
-
@ben_warre said in Chrome only allows 1000 iframes:
@sloosecannon said in Chrome only allows 1000 iframes:
@ben_warre have you perhaps considered using ajax calls to get the data rather than iframes?
Iframes I can do. Ajax I have not played with
$("#someDiv").load(http://www.example.com/test.html);
Probably doesn't work cross-domain, but I've never used iframes so I don't know if that's any different.
-
@mott555 Well it depends on how the iframe is delivering the data.
If it's an HTML table or something (say from an old reporting site that never imagined being embedded in another site) it might be kind of a bitch to parse-out, since you just get the text of the page, no actual DOM. (Although you could work around that with a bit of effort-- you could tell the browser to create a DOM by setting the InnerHTML of some element to the contents received, then yank stuff out of it.)
If it's a JSONP-like page that has a nice handy JS variable containing the data right there in the window object, then it's a lot easier to parse-out the data. You just need to know the variable name and do a bit of text searching for its value.
In either case, XSS restrictions apply, although if it's the latter case it might be interesting to see what happens if you tell the browser to load it as a
<script>
tag, like you would with an actual JSONP data source. (It probably won't work, since it's obviously not script. But I'm not sure what browsers do.)Then again come to think of it, since XSS applies to iFrames now, whatever you're currently doing would also be acceptable under AJAX rules. It's the same rules.
-
@mott555 said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
@sloosecannon said in Chrome only allows 1000 iframes:
@ben_warre have you perhaps considered using ajax calls to get the data rather than iframes?
Iframes I can do. Ajax I have not played with
$("#someDiv").load(http://www.example.com/test.html);
Probably doesn't work cross-domain, but I've never used iframes so I don't know if that's any different.
How is that really any different to iframe.src =?
Both the list and the info iframe html are on the same domain.
BTW, the whole system works pretty well. It's just if you list everything with no filters it shows only the divs after row 1000. Essentially I don't care or mind it just stuck me as odd for there to be a limit.
-
@tsaukpaetra I set the src only when the div is clicked.
It makes for an accordion style page.
-
@ben_warre said in Chrome only allows 1000 iframes:
How is that really any different to iframe.src =?
It's not an iframe, I guess. I normally used it on DIVs to run-time load other views in a single-page web application.
-
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
The iframes don't do anything until you click the div.
They don't exist? Or you don't set the src until you click the div? Because AFAIK simply hiding an iframe doesn't stop it from loading its source...
See the problem is that a simple query takes about 5 seconds for each job. So I can't generate all the info on the fly.
So I cache the primary key and easy data in a fast database and use that for my divs.
Then the iframe loads the slow bit as and when needed.
-
@ben_warre What about creating the iframe when the user clicks?
-
@hungrier that I could probably do.
-
@hungrier said in Chrome only allows 1000 iframes:
@ben_warre What about creating the iframe when the user clicks?
Careful there, you're on a slippery slope that will lead to infiniscroll if you don't watch out!
-
@ben_warre said in Chrome only allows 1000 iframes:
How is that really any different to iframe.src =?
Takes a lot less memory, since the string returned wouldn't have any Window or Document overhead associated with it, plus you can then throw away all of it you don't really need for your application. You could do it more than 1000 times during a page's lifecycle (assuming the browser's garbage collection doesn't screw you).
I mean since we don't know exactly what information is being passed via. iframe it's hard to say if this is better or worse than what you're doing.
@ben_warre said in Chrome only allows 1000 iframes:
See the problem is that a simple query takes about 5 seconds for each job. So I can't generate all the info on the fly.
AJAX certainly wouldn't fix that. It'd still take just as long for your server to create the page.
-
-
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
I am lost...when did we get on the subject of Discourse?
-
@polygeekery said in Chrome only allows 1000 iframes:
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
I am lost...when did we get on the subject of Discourse?
When I supposed some assumptions.
-
@blakeyrat said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
How is that really any different to iframe.src =?
Takes a lot less memory, since the string returned wouldn't have any Window or Document overhead associated with it, plus you can then throw away all of it you don't really need for your application. You could do it more than 1000 times during a page's lifecycle (assuming the browser's garbage collection doesn't screw you).
I mean since we don't know exactly what information is being passed via. iframe it's hard to say if this is better or worse than what you're doing.
@ben_warre said in Chrome only allows 1000 iframes:
See the problem is that a simple query takes about 5 seconds for each job. So I can't generate all the info on the fly.
AJAX certainly wouldn't fix that. It'd still take just as long for your server to create the page.
Plus, I guess the data would be in the DOM so searchable...
Currently it's display-only so no complex communications.
-
@polygeekery said in Chrome only allows 1000 iframes:
@tsaukpaetra said in Chrome only allows 1000 iframes:
@ben_warre said in Chrome only allows 1000 iframes:
an iframe underneath that loads a page which gets more data from the shitty slow database.
Perhaps the reason it's shitty slow is because a webpage is trying to load all the things at once in the background?
I am lost...when did we get on the subject of Discourse?
I kinda miss the days when every thread devolved into a discussion of Discourse bugs; it really helped build a strong sense of community.
-
@hardwaregeek said in Chrome only allows 1000 iframes:
I kinda miss the days when every thread devolved into a discussion of Discourse bugs
those days haven't left us!!