@@ -8,23 +8,9 @@ declare type VMScriptInjectInto = 'auto' | 'page' | 'content';
88declare type GenericObject = Record < string , unknown > ;
99
1010declare interface VMScriptGMInfoPlatform {
11- arch : 'arm' | 'arm64' | 'x86-32' | 'x86-64' | 'mips' | 'mips64' ;
12- /** @alias browserBrand
13- * @since VM2.15.7, Chrome 90 */
14- brand : string ;
15- /**
16- * The most meaningful pick (i.e. non-generic) from navigator.userAgentData.brands or ''.
17- * @since VM2.15.7, Chrome 90
18- */
19- browserBrand : string ;
11+ arch : 'aarch64' | 'arm' | 'arm64' | 'mips' | 'mips64' | 'ppc64' | 's390x' | 'sparc64' | 'x86-32' | 'x86-64' ;
2012 browserName : 'chrome' | 'firefox' | string ;
2113 browserVersion : string ;
22- /** @alias browserName
23- * @since VM2.15.7 */
24- name : string ;
25- /** @alias browserVersion
26- * @since VM2.15.7 */
27- version : string ;
2814 os : 'mac' | 'win' | 'android' | 'cros' | 'linux' | 'openbsd' | 'fuchsia' ;
2915}
3016
@@ -64,6 +50,10 @@ declare interface VMScriptGMInfoScriptMeta {
6450declare interface VMScriptGMInfoObject {
6551 /** Unique ID of the script. */
6652 uuid : string ;
53+ /** The injection mode of current script. */
54+ injectInto : VMScriptInjectInto ;
55+ /** Contains structured fields from the *Metadata Block*. */
56+ script : VMScriptGMInfoScriptMeta ;
6757 /** The meta block of the script. */
6858 scriptMetaStr : string ;
6959 /** Whether the script will be updated automatically. */
@@ -79,10 +69,14 @@ declare interface VMScriptGMInfoObject {
7969 * extension API (`browser.runtime.getPlatformInfo` and `getBrowserInfo`).
8070 */
8171 platform : VMScriptGMInfoPlatform ;
82- /** Contains structured fields from the *Metadata Block*. */
83- script : VMScriptGMInfoScriptMeta ;
84- /** The injection mode of current script. */
85- injectInto : VMScriptInjectInto ;
72+ /**
73+ * A copy of navigator.userAgentData from the content script of the extension.
74+ * @since VM2.20.2 */
75+ userAgentData ?: {
76+ brands : { brand : string , version : string } [ ] ,
77+ mobile : boolean ,
78+ platform : string ,
79+ } ;
8680}
8781
8882/**
0 commit comments