Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Make Sentry work properly in the popup and recorder pages
Browse files Browse the repository at this point in the history
This lazy-loads sentry.js in those contexts.
  • Loading branch information
ianb committed Oct 3, 2019
1 parent fd7e9b4 commit 0ecc124
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 10 additions & 3 deletions extension/catcher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals Sentry, buildSettings */
/* globals Sentry, buildSettings, catcherAsyncSetup */

this.catcher = (function() {
const exports = {};
Expand All @@ -17,7 +17,8 @@ this.catcher = (function() {
if (!buildSettings.sentryDsn) {
return;
}
Sentry.init({
const sentryOptions = {
url: "/js/vendor/sentry.js",
dsn: buildSettings.sentryDsn,
release: manifest.version,
environment: buildSettings.channel,
Expand All @@ -39,7 +40,13 @@ this.catcher = (function() {
}
return event;
},
});
};
if (typeof Sentry === "undefined") {
window.SENTRY_DSK = sentryOptions;
catcherAsyncSetup();
} else {
Sentry.init(sentryOptions);
}
}

exports.capture = function(e) {
Expand Down
5 changes: 5 additions & 0 deletions extension/catcherAsyncSetup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ecc124

Please sign in to comment.