blob: 56ad00b797fa4e6df1edfe3f55dee9a2084e70e5 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/netinfo/#the-networkinformation-interface
enum ConnectionType {
"cellular",
"bluetooth",
"ethernet",
"wifi",
"wimax",
"other",
"none",
"unknown"
};
enum EffectiveConnectionType {
"slow-2g",
"2g",
"3g",
"4g"
};
typedef unrestricted double Megabit;
typedef unsigned long long Milliseconds;
[
ActiveScriptWrappable,
Exposed=(Window,Worker)
] interface NetworkInformation : EventTarget {
[RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoType] readonly attribute ConnectionType type;
[RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoDownlinkMax] readonly attribute Megabit downlinkMax;
[MeasureAs=NetInfoOnChange] attribute EventHandler onchange;
[RuntimeEnabled=NetInfoDownlinkMax, MeasureAs=NetInfoOnTypeChange] attribute EventHandler ontypechange;
[MeasureAs=NetInfoEffectiveType] readonly attribute EffectiveConnectionType effectiveType;
[MeasureAs=NetInfoRtt] readonly attribute Milliseconds rtt;
[MeasureAs=NetInfoDownlink] readonly attribute Megabit downlink;
[HighEntropy=Direct, MeasureAs=NetInfoSaveData] readonly attribute boolean saveData;
};