File tree 4 files changed +15
-1
lines changed
4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 73
73
"@std/random" : " jsr:@std/random@^0.1.0" ,
74
74
"@std/regexp" : " jsr:@std/regexp@^1.0.1" ,
75
75
"@std/text" : " jsr:@std/text@^1.0.12" ,
76
+ "browser-dtector" : " npm:browser-dtector@^4.1.0" ,
76
77
"compromise" : " npm:compromise@^14.14.3" ,
77
78
"esbuild" : " npm:esbuild@^0.25.2"
78
79
}
Original file line number Diff line number Diff line change @@ -202,7 +202,9 @@ <h1>An error has occurred</h1>
202
202
< ul >
203
203
< li > What did you do before this error occurred.</ li >
204
204
< li > The following error message: < code id ="error-code "> </ code > </ li >
205
- < li > The name of your browser and its version.</ li >
205
+ < li >
206
+ Your browser and its version: < span id ="browser-details "> </ span >
207
+ </ li >
206
208
</ ul >
207
209
< button id ="error-close-button "> Close</ button >
208
210
</ dialog >
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ if (LIVE_RELOAD) {
8
8
new EventSource ( "/esbuild" )
9
9
. addEventListener ( "change" , ( ) => location . reload ( ) ) ;
10
10
}
11
+ import BrowserDetector from "browser-dtector" ;
11
12
import { dictionary } from "../dictionary/dictionary.ts" ;
12
13
import { dictionaryParser } from "../dictionary/parser.ts" ;
13
14
import PROJECT_DATA from "../project_data.json" with { type : "json" } ;
@@ -130,6 +131,9 @@ function main(): void {
130
131
131
132
const errorBox = document . getElementById ( "error-box" ) as HTMLDialogElement ;
132
133
const errorCode = document . getElementById ( "error-code" ) as HTMLElement ;
134
+ const browserDetails = document . getElementById (
135
+ "browser-details" ,
136
+ ) as HTMLElement ;
133
137
const errorCloseButton = document . getElementById (
134
138
"error-close-button" ,
135
139
) as HTMLButtonElement ;
@@ -147,6 +151,8 @@ function main(): void {
147
151
// handle error
148
152
addEventListener ( "error" , ( event ) => {
149
153
errorCode . innerText = event . message ;
154
+ const details = new BrowserDetector ( navigator . userAgent ) . getBrowserInfo ( ) ;
155
+ browserDetails . innerText = `${ details . name } ${ details . version } ` ;
150
156
errorBox . showModal ( ) ;
151
157
} ) ;
152
158
You can’t perform that action at this time.
0 commit comments