|Issue 234:||Proposed patch adds support for navigator.onLine and online/offline window events|
|2 people starred this issue and may be notified of changes.||Back to list|
What steps will reproduce the problem? 1. navigate to http://www.gusverdun.com/cef/online/online.htm 2. disconnect all network. 3. observe lack of status update. 4. press refresh What is the expected output? What do you see instead? I expect a window.onoffline event to have fired when I disconnected the network and a window.online event if it got reconnected. I also expect the navigator.onLine property to reflect the current state of the network (at minimum, from an "am I at least attached" perspective). Also, the refresh in step 3 should have returned error -106 rather than -105: ERR_NAME_NOT_RESOLVED = -105, ERR_INTERNET_DISCONNECTED = -106, What version of the product are you using? On what operating system? r233 and earlier. I took a look at what Chromium does and added a net::NetworkChangeNotifier in the UI thread Init(). This gets the network monitoring logic up and running (has to be done before the IO and File threads get going as they also register for notifications. The rest of the change adds a CefProcessUIThread::OnOnlineStateChanged method and hooks it up to get notified. This method forwards the event to WebKit. This fix resolves the above issues on Windows. The Mac version of the net::NetworkChangeNotifier is not yet up to par Windows (IsOffline() always returns false.) Attached is the proposed patch (relative to r233)
May 18, 2011
Thanks, committed as revision 234 with minor coding style changes.
|► Sign in to add a comment|