mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
move telemetry code to only run on Seqta pages
This commit is contained in:
+18
-20
@@ -23,26 +23,6 @@ import stringToHTML from './seqta/utils/stringToHTML';
|
|||||||
import { updateAllColors } from './seqta/ui/colors/Manager';
|
import { updateAllColors } from './seqta/ui/colors/Manager';
|
||||||
import { updateBgDurations } from './seqta/ui/Animation';
|
import { updateBgDurations } from './seqta/ui/Animation';
|
||||||
|
|
||||||
browser.storage.local.get([ "telemetry" ]).then((telemetry) => {
|
|
||||||
if (telemetry.telemetry === true) {
|
|
||||||
Sentry.init({
|
|
||||||
dsn: "https://54bdb68e80b45182ded22ecf9fe9529c@o4506347383291904.ingest.sentry.io/4506347462393856",
|
|
||||||
integrations: [
|
|
||||||
new Sentry.BrowserTracing({
|
|
||||||
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
|
||||||
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
|
|
||||||
}),
|
|
||||||
new Sentry.Replay(),
|
|
||||||
],
|
|
||||||
// Performance Monitoring
|
|
||||||
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
|
||||||
// Session Replay
|
|
||||||
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
|
|
||||||
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
chrome?: any;
|
chrome?: any;
|
||||||
@@ -710,6 +690,24 @@ function main(storedSetting: SettingsState) {
|
|||||||
browser.runtime.sendMessage({ type: 'setDefaultStorage' });
|
browser.runtime.sendMessage({ type: 'setDefaultStorage' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (storedSetting.telemetry && storedSetting.onoff) {
|
||||||
|
Sentry.init({
|
||||||
|
dsn: "https://54bdb68e80b45182ded22ecf9fe9529c@o4506347383291904.ingest.sentry.io/4506347462393856",
|
||||||
|
integrations: [
|
||||||
|
new Sentry.BrowserTracing({
|
||||||
|
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
||||||
|
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
|
||||||
|
}),
|
||||||
|
new Sentry.Replay(),
|
||||||
|
],
|
||||||
|
// Performance Monitoring
|
||||||
|
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
||||||
|
// Session Replay
|
||||||
|
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
|
||||||
|
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const handleDisabled = () => {
|
const handleDisabled = () => {
|
||||||
waitForElm('.code').then(AppendElementsToDisabledPage);
|
waitForElm('.code').then(AppendElementsToDisabledPage);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user