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

Commit

Permalink
Add FORCE_SENTRY option for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Oct 3, 2019
1 parent 6a2ff9e commit fd7e9b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/buildSettings.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ this.buildSettings = {
buildTime: <%= buildTime %>,
backgroundTabRecorder: <%= !env.FOREGROUND %>,
channel: "<%- env.INSTALL_CHANNEL || "unknown" %>",
sentryDsn: <%= env.NO_SENTRY ? null : env.SENTRY_DSN || "https://[email protected]/458" %>,
sentryDsn: <%= (env.NO_SENTRY && !env.FORCE_SENTRY) ? null : env.SENTRY_DSN || "https://[email protected]/458" %>,
};
2 changes: 2 additions & 0 deletions extension/catcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ this.catcher = (function() {
const exports = {};
const hostname = location.hostname;

// Note Sentry is usually enabled for live builds and disabled for local development
// to test Sentry locally use FORCE_SENTRY=1 npm start
const activated = (exports.sentryActivated = !!buildSettings.sentryDsn);

function fixUrl(u) {
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"util.js",
"buildSettings.js",
"log.js",
<% if (! env.NO_SENTRY) { %>
<% if (! (env.NO_SENTRY && !env.FORCE_SENTRY)) { %>
"js/vendor/sentry.js",
<% } %>
"catcher.js",
Expand Down

0 comments on commit fd7e9b4

Please sign in to comment.