diff options
author | 2019-10-31 14:55:19 +0700 | |
---|---|---|
committer | 2019-10-31 14:55:19 +0700 | |
commit | fc6e64329773f29fc9eee28bc3f4a1a1b01f218d (patch) | |
tree | 1c28572f97ee8a3d842f30c6741111183a478fc5 /src | |
parent | #178 Fetch in-app news from Ferdi server only (diff) | |
download | ferdium-app-fc6e64329773f29fc9eee28bc3f4a1a1b01f218d.tar.gz ferdium-app-fc6e64329773f29fc9eee28bc3f4a1a1b01f218d.tar.zst ferdium-app-fc6e64329773f29fc9eee28bc3f4a1a1b01f218d.zip |
#160 Setup Sentry for Electron
Diffstat (limited to 'src')
-rw-r--r-- | src/index.html | 1 | ||||
-rw-r--r-- | src/index.js | 2 | ||||
-rw-r--r-- | src/sentry.js | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/index.html b/src/index.html index 7f223b662..31e8aa553 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -14,6 +14,7 @@ | |||
14 | <script> | 14 | <script> |
15 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); | 15 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); |
16 | 16 | ||
17 | require('./sentry') | ||
17 | const { isDevMode } = require('./environment'); | 18 | const { isDevMode } = require('./environment'); |
18 | if (isDevMode) { | 19 | if (isDevMode) { |
19 | const debugging = require('debug'); | 20 | const debugging = require('debug'); |
diff --git a/src/index.js b/src/index.js index 3453b46f7..bc3c9555a 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -39,6 +39,7 @@ import handleDeepLink from './electron/deepLinking'; | |||
39 | import { isPositionValid } from './electron/windowUtils'; | 39 | import { isPositionValid } from './electron/windowUtils'; |
40 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved | 40 | import { appId } from './package.json'; // eslint-disable-line import/no-unresolved |
41 | import './electron/exception'; | 41 | import './electron/exception'; |
42 | import './sentry'; | ||
42 | 43 | ||
43 | import { | 44 | import { |
44 | DEFAULT_APP_SETTINGS, | 45 | DEFAULT_APP_SETTINGS, |
@@ -173,6 +174,7 @@ const createWindow = () => { | |||
173 | webPreferences: { | 174 | webPreferences: { |
174 | nodeIntegration: true, | 175 | nodeIntegration: true, |
175 | webviewTag: true, | 176 | webviewTag: true, |
177 | preload: path.join(__dirname, 'sentry.js') | ||
176 | }, | 178 | }, |
177 | }); | 179 | }); |
178 | 180 | ||
diff --git a/src/sentry.js b/src/sentry.js new file mode 100644 index 000000000..4f6d7205d --- /dev/null +++ b/src/sentry.js | |||
@@ -0,0 +1,5 @@ | |||
1 | import * as Sentry from '@sentry/electron'; | ||
2 | |||
3 | Sentry.init({ | ||
4 | dsn: 'https://f3d022fbcf6243a68a58d681c2122ee4@sentry.io/1803053', | ||
5 | }); | ||