1;(function () { 2 if (typeof wp_sentry === 'object') { 3 var listsWithRegexes = ['allowUrls', 'denyUrls', 'ignoreErrors', 'ignoreTransactions']; 4 var parseListWithRegexes = function (list) { 5 for (var url in list) { 6 if (list.hasOwnProperty(url)) { 7 if (list[url].startsWith('regex:')) { 8 list[url] = new RegExp(list[url].slice(6), 'i'); 9 } 10 } 11 } 12 }; 13 14 for (var i = 0; i < listsWithRegexes.length; i++) { 15 if (typeof wp_sentry[listsWithRegexes[i]] === 'object') { 16 parseListWithRegexes(wp_sentry[listsWithRegexes[i]]); 17 } 18 } 19 20 wp_sentry.integrations = []; 21 22 // Enable replay if a sample rate is set 23 if (wp_sentry.replaysSessionSampleRate && wp_sentry.replaysSessionSampleRate > 0) { 24 wp_sentry.replaysSessionSampleRate = parseFloat(wp_sentry.replaysSessionSampleRate); 25 } 26 if (wp_sentry.replaysOnErrorSampleRate && wp_sentry.replaysOnErrorSampleRate > 0) { 27 wp_sentry.replaysOnErrorSampleRate = parseFloat(wp_sentry.replaysOnErrorSampleRate); 28 } 29 if (wp_sentry.replaysSessionSampleRate > 0 || wp_sentry.replaysOnErrorSampleRate > 0) { 30 wp_sentry.integrations.push(Sentry.replayIntegration(wp_sentry.wpSessionReplayOptions)); 31 } 32 33 // Enable tracing if a sample rate is set 34 if (wp_sentry.tracesSampleRate) { 35 wp_sentry.tracesSampleRate = parseFloat(wp_sentry.tracesSampleRate); 36 } 37 if (wp_sentry.tracesSampleRate && wp_sentry.tracesSampleRate > 0) { 38 wp_sentry.integrations.push(Sentry.browserTracingIntegration(wp_sentry.wpBrowserTracingOptions)); 39 } 40 41 // Enable feedback integration if options were provided 42 if (wp_sentry.wpBrowserFeedbackOptions && wp_sentry.wpBrowserFeedbackOptions.enabled === true) { 43 wp_sentry.integrations.push(Sentry.feedbackIntegration(wp_sentry.wpBrowserFeedbackOptions)); 44 } 45 46 // If the hook is defined we call it with the Sentry object so that the user can modify it 47 if (typeof wp_sentry_hook === 'function') { 48 var hookResult = wp_sentry_hook(wp_sentry); 49 50 // If the hook returns false we do not continue to initialize Sentry 51 if (hookResult === false) { 52 return; 53 } 54 } 55 56 Sentry.init(wp_sentry); 57 58 if (typeof wp_sentry.context === 'object') { 59 if (typeof wp_sentry.context.user === 'object') { 60 Sentry.setUser(wp_sentry.context.user); 61 } 62 63 if (typeof wp_sentry.context.tags === 'object') { 64 for (var tag in wp_sentry.context.tags) { 65 if (wp_sentry.context.tags.hasOwnProperty(tag)) { 66 Sentry.setTag(tag, wp_sentry.context.tags[tag]); 67 } 68 } 69 } 70 } 71 } 72})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.