You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracted this out of
#15307
This PR:
1. Moves things around in the `sdk.ts` file a bit, moving types & consts
to the top of the file
2. Removes an "unecessary" log around fetch not being supported: This
log has two problems. First, it is not actually logged, because we do
`logger.log()` before running `init()`, which would actually set the
logger up. So the log would never show up. Second, the log is
superfluous, if the (default) fetch transport fails to send because
fetch is not available, you get a warning anyhow for this.
3. Streamlines the browser extension check code slightly.
Closes#16284
Copy file name to clipboardExpand all lines: dev-packages/browser-integration-tests/suites/manual-client/skip-init-browser-extension/test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ sentryTest(
23
23
if(hasDebugLogs()){
24
24
expect(errorLogs.length).toEqual(1);
25
25
expect(errorLogs[0]).toEqual(
26
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
26
+
'[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
Copy file name to clipboardExpand all lines: dev-packages/browser-integration-tests/suites/manual-client/skip-init-chrome-extension/test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ sentryTest('should not initialize when inside a Chrome browser extension', async
21
21
if(hasDebugLogs()){
22
22
expect(errorLogs.length).toEqual(1);
23
23
expect(errorLogs[0]).toEqual(
24
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
24
+
'[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
Copy file name to clipboardExpand all lines: packages/browser/test/sdk.test.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ describe('init', () => {
149
149
150
150
expect(consoleErrorSpy).toBeCalledTimes(1);
151
151
expect(consoleErrorSpy).toHaveBeenCalledWith(
152
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
152
+
'[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
153
153
);
154
154
155
155
consoleErrorSpy.mockRestore();
@@ -164,7 +164,7 @@ describe('init', () => {
164
164
165
165
expect(consoleErrorSpy).toBeCalledTimes(1);
166
166
expect(consoleErrorSpy).toHaveBeenCalledWith(
167
-
'[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
167
+
'[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/',
0 commit comments