-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit 76b7f3a
feat(browser): Disable client when browser extension is detected in
Similar to #16353,
this changes how default options for BrowserClient are handled. Instead
of building this in `init`, we now do (some) of it in BrowserClient.
Additionally, this also adjusts what we do if we detect a browser
extension: Instead of skipping the setup, we now just disable the
client. This streamlines this a bit and also ensures that we actually
always return a `Client` from init.
It also fixes the type for `BrowserOption` to actually allow to
configure `cdnBaseUrl`, which was actually only set for the
ClientOptions, oops.
The reason for this is to streamline the `init` code, making it easier
to extend/adjust it. Right now, there is a lot going on in different
places there. By moving as much as we can (and makes sense) to
`BrowserClient` this becomes a bit easier. While playing with different
ways to handle the browser extension stuff, I ended up landing on just
disabling the SDK in this scenario.init() (#16354)1 parent 349d7d0 commit 76b7f3a
File tree
7 files changed
+192
-232
lines changed- dev-packages/browser-integration-tests/suites/manual-client
- skip-init-browser-extension
- skip-init-chrome-extension
- packages/browser
- src
- utils
- test
7 files changed
+192
-232
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | - | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | - | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
24 | 29 | | |
25 | 30 | | |
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
31 | - | ||
32 | - | ||
41 | + | ||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
| |||
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | - | ||
58 | - | ||
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | ||
66 | + | ||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | - | ||
79 | - | ||
80 | - | ||
81 | - | ||
82 | - | ||
82 | + | ||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | ||
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | ||
166 | + | ||
167 | + | ||
168 | + | ||
169 | + | ||
170 | + | ||
171 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | - | ||
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | - | ||
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | - | ||
15 | - | ||
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
| |||
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | - | ||
25 | - | ||
26 | - | ||
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | ||
31 | - | ||
32 | - | ||
33 | - | ||
34 | - | ||
35 | - | ||
36 | - | ||
37 | - | ||
38 | - | ||
39 | - | ||
20 | + | ||
40 | 21 | | |
41 | 22 | | |
42 | 23 | | |
| |||
59 | 40 | | |
60 | 41 | | |
61 | 42 | | |
62 | - | ||
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | ||
67 | - | ||
68 | - | ||
69 | - | ||
70 | - | ||
71 | - | ||
72 | - | ||
73 | - | ||
74 | - | ||
75 | - | ||
76 | - | ||
77 | - | ||
78 | - | ||
79 | - | ||
80 | - | ||
81 | - | ||
82 | - | ||
83 | - | ||
84 | - | ||
85 | - | ||
86 | - | ||
87 | - | ||
88 | - | ||
89 | - | ||
90 | - | ||
91 | - | ||
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | ||
96 | 43 | | |
97 | 44 | | |
98 | 45 | | |
| |||
139 | 86 | | |
140 | 87 | | |
141 | 88 | | |
142 | - | ||
143 | - | ||
144 | - | ||
145 | - | ||
89 | + | ||
90 | + | ||
91 | + | ||
146 | 92 | | |
147 | - | ||
148 | 93 | | |
149 | 94 | | |
95 | + | ||
150 | 96 | | |
151 | - | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
152 | 102 | | |
153 | 103 | | |
154 | - | ||
155 | 104 | | |
156 | 105 | | |
157 | 106 | | |
| |||
170 | 119 | | |
171 | 120 | | |
172 | 121 | | |
173 | - | ||
174 | - | ||
175 | - | ||
176 | - | ||
177 | - | ||
178 | - | ||
179 | - | ||
180 | - | ||
181 | - | ||
182 | - | ||
183 | - | ||
184 | - | ||
185 | - | ||
186 | - | ||
187 | - | ||
188 | - | ||
189 | - | ||
190 | - | ||
191 | - | ||
192 | - | ||
193 | - | ||
194 | - | ||
195 | - | ||
196 | - | ||
197 | - | ||
198 | - | ||
199 | - | ||
200 | - | ||
201 | - | ||
202 | - | ||
203 | - | ||
204 | - | ||
205 | - | ||
206 | - | ||
207 | - | ||
208 | - | ||
209 | - | ||
210 | - | ||
211 | - | ||
212 | - | ||
213 | - | ||
214 | - | ||
215 | - | ||
216 | - | ||
217 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
0 commit comments