mirror of
https://github.com/shadps4-emu/ext-libusb.git
synced 2026-01-31 00:55:21 +01:00
tests: Fix Node.js shim for Node 21+ (webusb/emscripten)
Fixes #1648 Closes #1656
This commit is contained in:
committed by
Tormod Volden
parent
15a7ebb4d4
commit
4b9cf1fb04
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 11953
|
||||
#define LIBUSB_NANO 11954
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
|
||||
const { WebUSB } = require('usb');
|
||||
|
||||
globalThis.navigator = {
|
||||
usb: new WebUSB({
|
||||
allowAllDevices: true
|
||||
})
|
||||
};
|
||||
// Node.js 21 introduced a global `navigator` object, so assign an empty one only if it's not present yet.
|
||||
globalThis.navigator ??= {};
|
||||
|
||||
navigator.usb = new WebUSB({
|
||||
allowAllDevices: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user