Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interfaces/ua-client-hints.idl and test (#24223)
Closes #24218
- Loading branch information
1 parent
45d47b2
commit c43518a
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// GENERATED CONTENT - DO NOT EDIT | ||
// Content was automatically extracted by Reffy into reffy-reports | ||
// (https://github.com/tidoust/reffy-reports) | ||
// Source: User-Agent Client Hints (https://wicg.github.io/ua-client-hints/) | ||
|
||
dictionary NavigatorUABrandVersion { | ||
DOMString brand; | ||
DOMString version; | ||
}; | ||
|
||
dictionary UADataValues { | ||
DOMString platform; | ||
|
||
DOMString platformVersion; | ||
DOMString architecture; | ||
DOMString model; | ||
DOMString uaFullVersion; | ||
}; | ||
|
||
[Exposed=(Window,Worker)] | ||
interface NavigatorUAData { | ||
readonly attribute FrozenArray<NavigatorUABrandVersion> brands; | ||
readonly attribute boolean mobile; | ||
Promise<UADataValues> getHighEntropyValues(sequence<DOMString> hints); | ||
}; | ||
|
||
interface mixin NavigatorUA { | ||
[SecureContext] readonly attribute NavigatorUAData userAgentData; | ||
}; | ||
|
||
Navigator includes NavigatorUA; | ||
WorkerNavigator includes NavigatorUA; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// META: script=/resources/WebIDLParser.js | ||
// META: script=/resources/idlharness.js | ||
|
||
'use strict'; | ||
|
||
// https://wicg.github.io/ua-client-hints/ | ||
|
||
idl_test( | ||
['ua-client-hints'], | ||
['html', 'dom'], | ||
idl_array => { | ||
if (self.GLOBAL.isWorker()) { | ||
idl_array.add_objects({ WorkerNavigator: ['navigator'] }); | ||
} else { | ||
idl_array.add_objects({ Navigator: ['navigator'] }); | ||
} | ||
idl_array.add_objects({ | ||
NavigatorUAData: ['navigator.userAgentData'], | ||
}); | ||
} | ||
); |