Commit 9c2519a
authored
Fix browser
The driver was trying to access the `window` object inside web workers. This object doesn't exist in this context.
So, the driver was throwing an error and not creating connections at all.
This problem is solved by access the `navigator` directly from the global scope (which is the `window` outside the web workers). Some guards were added to avoid the code break in case `navigator` is not defined.boltAgent in web workers context (#1094)1 parent 5127f3a commit 9c2519a
File tree
3 files changed
+20
-2
lines changed- packages
- core
- src/internal/bolt-agent/browser
- test/internal/bolt-agent/browser
- neo4j-driver-deno/lib/core/internal/bolt-agent/browser
3 files changed
+20
-2
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | | - | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
69 | 79 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | | - | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
0 commit comments