I have a website that uses a comet connection with a long poll. The connection should be configured to load / after the page loads.
Despite my efforts to prevent this, many browsers consider the long poll query as part of the page loading mechanism, thereby preserving the page at the loading stage. In Safari, this causes the progress bar (beyond the url field) to not end. In Chrome, the icon appears as a download icon. Even more problematic is the mobile safari on the iphone, which does not allow you to hide the url field at boot time. Android mobile devices have similar problems on some devices.
In general, the behavior is difficult to reproduce and seems to depend on the speed of the browser / platform / connection / etc. Right now, my code is initiating a long poll of 10 ms after the window.onLoad trigger. This seems to work very often, but not always. I suspect that this may have something to do with loading some external (images / javascript) resources, but it can be said that the onLoad event is fired after they are fully loaded.
Does anyone point out how to get these browsers to view my page as loaded? Ideally, you can somehow mark xmlhttprequest as a comet, but this is not a function :).
source share