tasmota-webserial-esptool 9.1.1 → 9.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/script.js +2 -1
- package/js/webusb-serial.js +6 -0
- package/package.json +1 -1
package/js/script.js
CHANGED
|
@@ -267,9 +267,10 @@ async function loadWebUSBSerial() {
|
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
// Dynamically load the WebUSB serial script
|
|
270
|
+
// Dynamically load the WebUSB serial script as ES6 module
|
|
271
271
|
return new Promise((resolve, reject) => {
|
|
272
272
|
const script = document.createElement("script");
|
|
273
|
+
script.type = "module"; // CRITICAL: Load as ES6 module to support export statements
|
|
273
274
|
script.src = "js/webusb-serial.js";
|
|
274
275
|
script.onload = () => {
|
|
275
276
|
// Verify it loaded correctly
|
package/js/webusb-serial.js
CHANGED
|
@@ -1024,5 +1024,11 @@ async function requestSerialPort(forceNew = false) {
|
|
|
1024
1024
|
throw new Error('Neither Web Serial API nor WebUSB is supported in this browser');
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
|
+
// Also set on globalThis for non-module usage (e.g., dynamic script loading)
|
|
1028
|
+
if (typeof globalThis !== 'undefined') {
|
|
1029
|
+
globalThis.WebUSBSerial = WebUSBSerial;
|
|
1030
|
+
globalThis.requestSerialPort = requestSerialPort;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1027
1033
|
// Export as ES modules
|
|
1028
1034
|
export { WebUSBSerial, requestSerialPort };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tasmota-webserial-esptool",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.3",
|
|
4
4
|
"description": "World's first tool for flashing and reading ESP devices on Android mobile devices using WebUSB. Flash & Read ESP devices using WebSerial/WebUSB - up to 10x faster flash read than esptool.py",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|