Skip to content

Commit

Permalink
Add interfaces/ua-client-hints.idl and test (#24223)
Browse files Browse the repository at this point in the history
Closes #24218
  • Loading branch information
stephenmcgruer committed Jun 29, 2020
1 parent 45d47b2 commit c43518a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions interfaces/ua-client-hints.idl
@@ -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;
21 changes: 21 additions & 0 deletions ua-client-hints/idlharness.https.any.js
@@ -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'],
});
}
);

0 comments on commit c43518a

Please sign in to comment.