My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
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
Status:  Fixed
Owner:  ----
Closed:  May 2011


Sign in to add a comment
 
Reported by gusver...@gmail.com, May 17, 2011
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)
fix_navigator_onLine.patch
2.8 KB   View   Download
May 18, 2011
Project Member #1 magreenb...@gmail.com
Thanks, committed as revision 234 with minor coding style changes.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting