MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / setupOnce

Function setupOnce

packages/feedback/src/core/integration.ts:343–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341 return {
342 name: 'Feedback' as const,
343 setupOnce() {
344 if (!isBrowser() || !_options.autoInject) {
345 return;
346 }
347
348 if (DOCUMENT.readyState === 'loading') {
349 DOCUMENT.addEventListener('DOMContentLoaded', () => _createActor().appendToDom());
350 } else {
351 _createActor().appendToDom();
352 }
353 },
354
355 /**
356 * Adds click listener to the element to open a feedback dialog

Callers

nothing calls this directly

Calls 3

isBrowserFunction · 0.90
_createActorFunction · 0.85
addEventListenerMethod · 0.65

Tested by

no test coverage detected