-
Notifications
You must be signed in to change notification settings - Fork 60
feat(background-capture): adding background capture injection to auto… #1501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const VERSION = '2.33.1'; | ||
| export const VERSION = '2.33.2-SR-2360.0'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const VERSION = '1.5.29'; | ||
| export const VERSION = '1.5.30-SR-2360.0'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const VERSION = '1.5.32'; | ||
| export const VERSION = '1.5.33-SR-2360.0'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,10 @@ export const autocapturePlugin = ( | |
| enabled: true, | ||
| messenger: new WindowMessenger(), | ||
| }, | ||
| backgroundCaptureOptions = { | ||
| enabled: true, | ||
| messenger: new WindowMessenger(), | ||
| }, | ||
| } = options; | ||
|
|
||
| options.cssSelectorAllowlist = options.cssSelectorAllowlist ?? DEFAULT_CSS_SELECTOR_ALLOWLIST; | ||
|
|
@@ -294,7 +298,6 @@ export const autocapturePlugin = ( | |
|
|
||
| /* istanbul ignore next */ | ||
| config?.loggerProvider?.log(`${name} has been successfully added.`); | ||
|
|
||
| // Setup visual tagging selector | ||
| if (window.opener && visualTaggingOptions.enabled) { | ||
| const allowlist = (options as AutoCaptureOptionsWithDefaults).cssSelectorAllowlist; | ||
|
|
@@ -310,6 +313,15 @@ export const autocapturePlugin = ( | |
| actionClickAllowlist: actionClickAllowlist, | ||
| }); | ||
| } | ||
|
|
||
| // Setup background capture messenger if it is not already setup for visual tagging selector | ||
| if (window.opener && backgroundCaptureOptions.enabled && !visualTaggingOptions.messenger) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| /* istanbul ignore next */ | ||
| backgroundCaptureOptions.messenger?.setup({ | ||
| dataExtractor: dataExtractor, | ||
| logger: config?.loggerProvider, | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| const execute: BrowserEnrichmentPlugin['execute'] = async (event) => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backgroundCaptureOptions.messengerisn’t initialized whenvisualTaggingis disabled becausevisualTaggingOptions.messengeralways defaults to a value. Consider basing the check on!visualTaggingOptions.enabled(or whether the messengers differ) so background capture initializes when enabled.