File tree Expand file tree Collapse file tree 14 files changed +91
-59
lines changed
enable-pluggable-integrations-lazy
enable-pluggable-integrations
platforms/javascript/common/install Expand file tree Collapse file tree 14 files changed +91
-59
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ function SentryLoaderConfig() {
53
53
key = "sentry-loader-config"
54
54
dangerouslySetInnerHTML = { {
55
55
__html : `
56
- Sentry.onLoad(function() {
56
+ window.Sentry && Sentry.onLoad(function() {
57
57
Sentry.init({
58
58
integrations: [
59
59
new Sentry.Replay({
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.CaptureConsole ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.CaptureConsole ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.ContextLines ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.ContextLines ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.Debug ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.Debug ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.Dedupe ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.Dedupe ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -23,9 +23,17 @@ Sentry.addIntegration(new ReportingObserver());
23
23
></script >
24
24
25
25
<script >
26
- Sentry .onLoad (function () {
27
- Sentry .init ({
28
- integrations: [],
26
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
27
+ window .Sentry &&
28
+ Sentry .onLoad (function () {
29
+ Sentry .init ({
30
+ integrations: [],
31
+ });
32
+
33
+ const client = Sentry .getCurrentHub ().getClient ();
34
+ if (client) {
35
+ client .addIntegration (new Sentry.Integrations.ReportingObserver ());
36
+ }
29
37
});
30
38
31
39
Sentry .addIntegration (new Sentry.Integrations.ReportingObserver ());
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.ReportingObserver ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.ReportingObserver ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ Sentry.init({
22
22
></script >
23
23
24
24
<script >
25
- Sentry .onLoad (function () {
26
- Sentry .init ({
27
- integrations: [new Sentry.Integrations.ExtraErrorData ()],
25
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
26
+ window .Sentry &&
27
+ Sentry .onLoad (function () {
28
+ Sentry .init ({
29
+ integrations: [new Sentry.Integrations.ExtraErrorData ()],
30
+ });
28
31
});
29
- });
30
32
</script >
31
33
```
32
34
Original file line number Diff line number Diff line change @@ -25,14 +25,16 @@ Sentry.init({
25
25
></script >
26
26
27
27
<script >
28
- Sentry .onLoad (function () {
29
- Sentry .init ({
30
- integrations: [new Sentry.Integrations.HttpClient ()],
31
-
32
- // This option is required for capturing headers and cookies.
33
- sendDefaultPii: true ,
28
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
29
+ window .Sentry &&
30
+ Sentry .onLoad (function () {
31
+ Sentry .init ({
32
+ integrations: [new Sentry.Integrations.HttpClient ()],
33
+
34
+ // This option is required for capturing headers and cookies.
35
+ sendDefaultPii: true ,
36
+ });
34
37
});
35
- });
36
38
</script >
37
39
```
38
40
Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ Sentry.init({
16
16
></script >
17
17
18
18
<script >
19
- Sentry .onLoad (function () {
20
- Sentry .init ({
21
- integrations: [new Sentry.Integrations.ModuleMetadata ()],
19
+ // Check for existence of Sentry in case Ad-blockers block the Sentry Loader Script
20
+ window .Sentry &&
21
+ Sentry .onLoad (function () {
22
+ Sentry .init ({
23
+ integrations: [new Sentry.Integrations.ModuleMetadata ()],
24
+ });
22
25
});
23
- });
24
26
</script >
25
27
```
26
28
You can’t perform that action at this time.
0 commit comments