Add is_headless as a field instead of filter (#55483)
This commit is contained in:
@@ -86,8 +86,6 @@ export function sendEvent<T extends EventType>({
|
|||||||
eventGroupKey?: string
|
eventGroupKey?: string
|
||||||
eventGroupId?: string
|
eventGroupId?: string
|
||||||
} & EventPropsByType[T]) {
|
} & EventPropsByType[T]) {
|
||||||
if (isHeadless()) return
|
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
type,
|
type,
|
||||||
|
|
||||||
@@ -118,6 +116,7 @@ export function sendEvent<T extends EventType>({
|
|||||||
// Device information
|
// Device information
|
||||||
// os, os_version, browser, browser_version:
|
// os, os_version, browser, browser_version:
|
||||||
...parseUserAgent(),
|
...parseUserAgent(),
|
||||||
|
is_headless: isHeadless(),
|
||||||
viewport_width: document.documentElement.clientWidth,
|
viewport_width: document.documentElement.clientWidth,
|
||||||
viewport_height: document.documentElement.clientHeight,
|
viewport_height: document.documentElement.clientHeight,
|
||||||
|
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ const context = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'The version of the browser the user is browsing with.',
|
description: 'The version of the browser the user is browsing with.',
|
||||||
},
|
},
|
||||||
|
is_headless: {
|
||||||
|
type: 'boolean',
|
||||||
|
},
|
||||||
viewport_width: {
|
viewport_width: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: 'The viewport width, not the overall device size.',
|
description: 'The viewport width, not the overall device size.',
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ describe('POST /events', () => {
|
|||||||
os_version: '18.04',
|
os_version: '18.04',
|
||||||
browser: 'chrome',
|
browser: 'chrome',
|
||||||
browser_version: '85.0.4183.121',
|
browser_version: '85.0.4183.121',
|
||||||
|
is_headless: false,
|
||||||
viewport_width: 1418,
|
viewport_width: 1418,
|
||||||
viewport_height: 501,
|
viewport_height: 501,
|
||||||
|
|
||||||
@@ -72,6 +73,7 @@ describe('POST /events', () => {
|
|||||||
os_version: '18.04',
|
os_version: '18.04',
|
||||||
browser: 'chrome',
|
browser: 'chrome',
|
||||||
browser_version: '85.0.4183.121',
|
browser_version: '85.0.4183.121',
|
||||||
|
is_headless: false,
|
||||||
viewport_width: 1418,
|
viewport_width: 1418,
|
||||||
viewport_height: 501,
|
viewport_height: 501,
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export type EventProps = {
|
|||||||
code_display_preference: string
|
code_display_preference: string
|
||||||
event_group_key?: string
|
event_group_key?: string
|
||||||
event_group_id?: string
|
event_group_id?: string
|
||||||
|
is_headless: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user