I am just curious as to why there appears to be a hex number associated with each source in this Chrome debugger output here ...
WebSocket is already in CLOSING or CLOSED state.
(anonymous) @ websocket.js?13d9:192
exports.encodePacket @ browser.js?9636:123
(anonymous) @ websocket.js?13d9:170
WS.write @ websocket.js?13d9:202
Transport.send @ transport.js?87a5:110
Socket.flush @ socket.js?1006:565
Socket.sendPacket @ socket.js?1006:625
Socket.ping @ socket.js?1006:529
(anonymous) @ socket.js?1006:516
setTimeout (async)
Socket.setPing @ socket.js?1006:514
Socket.onPacket @ socket.js?1006:445
(anonymous) @ socket.js?1006:273
Emitter.emit @ index.js?ea2f:133
Transport.onPacket @ transport.js?87a5:145
Transport.onData @ transport.js?87a5:137
ws.onmessage @ websocket.js?13d9:147
For example, the source websocket.js
correlates to 13d9
.
Where does this hex value come from and what is it used for?
I am not concerned with the actual error in this case, I'm just using it for an example.
This is part of your file's URL.
Can't tell for sure what does set it in this case, but it's a common way to avoid caching when updating a js file.
Chrome's console output doesn't expose the column number, so what you have after the :
is the line number.
const script = document.createElement('script'); const blob = new Blob([`const foo = "bar"; // should throw at line 3 throw new TypeError('not a baz');`], {type: "application/javacript"}); script.src = URL.createObjectURL(blob); document.head.appendChild(script);
Results in
Uncaught TypeError: not a baz blob:null/96273a46-9...a3b1-12d1f1f3355c:3
at 96273a46-9f81-4eed-a3b1-12d1f1f3355c:3
As you can see, only the line number is shown here, even though, the Error.stack
message does expose the column number in the form script_url:lineno:colno
const script = document.createElement('script'); const blob = new Blob([`console.log(new Error('foo').stack);`], {type: "application/javacript"}); script.src = URL.createObjectURL(blob); document.head.appendChild(script); /* Error: foo at blob:null/[random-blob-url]:1:13 */
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.