mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Add navigator.onLine. Bug 23435, r+sr=jst
This commit is contained in:
parent
62a15ea511
commit
9525428ff4
@ -40,7 +40,7 @@
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(a6cf906e-15b3-11d2-932e-00805f8add32)]
|
||||
[scriptable, uuid(8758b72b-63d4-4685-b908-4275126410fb)]
|
||||
interface nsIDOMNavigator : nsISupports
|
||||
{
|
||||
readonly attribute DOMString appCodeName;
|
||||
@ -58,6 +58,7 @@ interface nsIDOMNavigator : nsISupports
|
||||
readonly attribute DOMString securityPolicy;
|
||||
readonly attribute DOMString userAgent;
|
||||
readonly attribute boolean cookieEnabled;
|
||||
readonly attribute boolean onLine;
|
||||
|
||||
boolean javaEnabled();
|
||||
boolean taintEnabled();
|
||||
|
@ -6215,6 +6215,22 @@ NavigatorImpl::GetCookieEnabled(PRBool *aCookieEnabled)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NavigatorImpl::GetOnLine(PRBool* aOnline)
|
||||
{
|
||||
NS_PRECONDITION(aOnline, "Null out param");
|
||||
|
||||
*aOnline = PR_FALSE; // No ioservice would mean this is the case
|
||||
|
||||
nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
|
||||
if (ios) {
|
||||
ios->GetOffline(aOnline);
|
||||
*aOnline = !*aOnline;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NavigatorImpl::JavaEnabled(PRBool *aReturn)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user