IntersectionObserver not reporting intersection for empty iframe
Reported by
mohdakra...@gmail.com,
Sep 11
|
|||||||
Issue description
Chrome Version : 69.0.3497.81 (Official Build) (64-bit)
Other browsers tested:
Safari: N/A
Firefox: OK 63.0b4
Edge: OK 42.17134.1.0
What steps will reproduce the problem?
(1) Create an iframe with the following:
<!doctype html>
<html lang="en">
<head>
<title>Title</title>
</head>
<body>
<script>
var io = new IntersectionObserver(function(entries) {
for (var i = 0; i < entries.length; i++) {
if (entries[i].isIntersecting) {
console.log('intersecting');
io.disconnect();
}
}
});
io.observe(document.body);
</script>
</body>
</html>
(2) Embed it in a document
What is the expected result?
"intersecting" is printed to the console.
What happens instead?
Nothing is printed.
Workaround: Add a non-space character to the HTML body.
This issue seems to have started in a recent version of Chrome.
I discovered it because I had an iframe that only loaded itself when in view.
,
Sep 11
,
Sep 11
,
Sep 11
,
Sep 11
I can't reproduce this in version 70.0.3538.9 (dev channel) on Linux. Can you please try again on dev channel Chrome and see if it still reproduces?
,
Sep 12
It reproduces for me on Windows and macOS. It only seems to reproduce if the iframe's domain is different, strangely enough. I created an iframe.html file with the contents I previously mentioned. I then created another index.html with this:
<!doctype html>
<html lang="en">
<head>
<title>Title</title>
</head>
<body>
<iframe src="http://localhost2:8000/iframe.html"></iframe>
</body>
</html>
Edit the hosts file and add this entry:
127.0.0.1 localhost2
Now, run a server in the folder of the two files. I used Python's `python3 -m http.server`.
If you go to localhost:8000, it won't print "intersecting". If you go to localhost2:8000, it will.
,
Sep 12
Tried testing the issue on reported chrome version 69.0.3497.81 on Windows 10 by following below steps. Steps: ===== 1.Launched chrome. 2.Copied the code snippet from Comment#6 into a notepad and save with ".html" extension. 3.Ran the server by using "python -m SimpleHTTPServer 8000" 4.Navigated to localhost2:8000 5.Observed that the site cannot be reached Attached screencast for reference. @reporter: Could you please review the attached screencast and let us know if anything is being missed here. Thanks.!
,
Sep 12
One step is missing - edit the hosts file and add: 127.0.0.1 localhost2 Instructions on how to edit the hosts file - https://support.rackspace.com/how-to/modify-your-hosts-file/.
,
Sep 14
This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone. All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly. This issue is marked as a release blocker with no OS labels associated. Please add an appropriate OS label. All release blocking issues should have OS labels associated to it, so that the issue can tracked and promptly verified, once it gets fixed. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 17
This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone. All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly. This issue is marked as a release blocker with no OS labels associated. Please add an appropriate OS label. All release blocking issues should have OS labels associated to it, so that the issue can tracked and promptly verified, once it gets fixed. Thanks for your time! To disable nags, add the Disable-Nags label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 19
The fact that it only happens when the iframe is in a different domain suggests that it's related to site isolation. However, I'm unable to reproduce this on either Linux or Mac, running version 69.0.3497.92. I am loading the iframe from a different origin, and I tried running chrome with the --site-per-process flag to double check. No luck.
,
Sep 20
Attached is a screen recording, tried on the latest Chromium, with data and settings cleared. I also thought it was some kind of site isolation, but fixing it by adding a character is strange. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by dtapu...@chromium.org
, Sep 11