webview-napi 0.1.6 → 0.1.8

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/index.d.ts CHANGED
@@ -61,16 +61,6 @@ export declare class EventLoop {
61
61
  export declare class EventLoopBuilder {
62
62
  /** Creates a new event loop builder. */
63
63
  constructor()
64
- /**
65
- * Forces X11 backend on Linux.
66
- * This must be called before build() to take effect.
67
- */
68
- withForceX11(force: boolean): this
69
- /**
70
- * Forces Wayland backend on Linux.
71
- * This must be called before build() to take effect.
72
- */
73
- withForceWayland(force: boolean): this
74
64
  /** Builds the event loop. */
75
65
  build(): EventLoop
76
66
  }
@@ -88,7 +78,15 @@ export declare class EventLoopWindowTarget {
88
78
 
89
79
  }
90
80
 
91
- /** Simple pixel renderer for Tao windows */
81
+ /**
82
+ * Simple pixel renderer for Tao windows
83
+ *
84
+ * NOTE: This renderer uses global caches to avoid X11 client limit errors.
85
+ * The "Maximum number of clients reached" error occurs when creating too many
86
+ * X11 contexts/surfaces. This implementation uses a global cache keyed by window ID
87
+ * to reuse rendering resources across render calls and even across different
88
+ * PixelRenderer instances.
89
+ */
92
90
  export declare class PixelRenderer {
93
91
  /** Creates a new pixel renderer with the given buffer dimensions */
94
92
  constructor(bufferWidth: number, bufferHeight: number)
@@ -104,6 +102,11 @@ export declare class PixelRenderer {
104
102
  * # Arguments
105
103
  * * `window` - The Tao window to render to
106
104
  * * `buffer` - RGBA pixel buffer (must be buffer_width * buffer_height * 4 bytes)
105
+ *
106
+ * # Performance Note
107
+ * This method uses global caches to avoid X11 "Maximum number of clients reached"
108
+ * errors that occur when creating new contexts/surfaces on each render call.
109
+ * Resources are cached per-window and reused across all PixelRenderer instances.
107
110
  */
108
111
  render(window: Window, buffer: Buffer): void
109
112
  }
@@ -335,10 +338,6 @@ export declare class WindowBuilder {
335
338
  withWindowIcon(icon: Buffer): this
336
339
  /** Sets the window theme. */
337
340
  withTheme(theme: TaoTheme): this
338
- /** Forces X11 backend on Linux. */
339
- withForceX11(force: boolean): this
340
- /** Forces Wayland backend on Linux. */
341
- withForceWayland(force: boolean): this
342
341
  /** Builds the window. */
343
342
  build(eventLoop: EventLoop): Window
344
343
  }
@@ -1180,6 +1179,10 @@ export interface RenderOptions {
1180
1179
  *
1181
1180
  * This is a convenience function for one-off renders.
1182
1181
  * For repeated rendering, use [`PixelRenderer`] instead.
1182
+ *
1183
+ * # Warning
1184
+ * Using this function repeatedly (200+ times) may cause X11 "Maximum number of clients reached"
1185
+ * errors. For repeated rendering, create a [`PixelRenderer`] instance and reuse it.
1183
1186
  */
1184
1187
  export declare function renderPixels(window: Window, buffer: Buffer, bufferWidth: number, bufferHeight: number): void
1185
1188
 
@@ -1465,10 +1468,6 @@ export interface WindowAttributes {
1465
1468
  icon?: Buffer
1466
1469
  /** The theme of window. */
1467
1470
  theme?: TaoTheme
1468
- /** Whether to force X11 backend on Linux (default: auto-detect) */
1469
- forceX11?: boolean
1470
- /** Whether to force Wayland backend on Linux (default: auto-detect) */
1471
- forceWayland?: boolean
1472
1471
  }
1473
1472
 
1474
1473
  /** Window drag details. */
@@ -1567,10 +1566,6 @@ export interface WindowOptions {
1567
1566
  icon?: Buffer
1568
1567
  /** The theme of window. */
1569
1568
  theme?: TaoTheme
1570
- /** Whether to force X11 backend on Linux (default: auto-detect) */
1571
- forceX11?: boolean
1572
- /** Whether to force Wayland backend on Linux (default: auto-detect) */
1573
- forceWayland?: boolean
1574
1569
  }
1575
1570
 
1576
1571
  /** Window size limits. */
package/index.js CHANGED
@@ -70,15 +70,15 @@ function requireNative() {
70
70
  } else if (process.platform === 'android') {
71
71
  if (process.arch === 'arm64') {
72
72
  try {
73
- return require('./webview.android-arm64.node')
73
+ return require('./webview-napi.android-arm64.node')
74
74
  } catch (e) {
75
75
  loadErrors.push(e)
76
76
  }
77
77
  try {
78
78
  const binding = require('webview-napi-android-arm64')
79
79
  const bindingPackageVersion = require('webview-napi-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -86,15 +86,15 @@ function requireNative() {
86
86
  }
87
87
  } else if (process.arch === 'arm') {
88
88
  try {
89
- return require('./webview.android-arm-eabi.node')
89
+ return require('./webview-napi.android-arm-eabi.node')
90
90
  } catch (e) {
91
91
  loadErrors.push(e)
92
92
  }
93
93
  try {
94
94
  const binding = require('webview-napi-android-arm-eabi')
95
95
  const bindingPackageVersion = require('webview-napi-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -107,15 +107,15 @@ function requireNative() {
107
107
  if (process.arch === 'x64') {
108
108
  if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
109
109
  try {
110
- return require('./webview.win32-x64-gnu.node')
110
+ return require('./webview-napi.win32-x64-gnu.node')
111
111
  } catch (e) {
112
112
  loadErrors.push(e)
113
113
  }
114
114
  try {
115
115
  const binding = require('webview-napi-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('webview-napi-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -123,15 +123,15 @@ function requireNative() {
123
123
  }
124
124
  } else {
125
125
  try {
126
- return require('./webview.win32-x64-msvc.node')
126
+ return require('./webview-napi.win32-x64-msvc.node')
127
127
  } catch (e) {
128
128
  loadErrors.push(e)
129
129
  }
130
130
  try {
131
131
  const binding = require('webview-napi-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('webview-napi-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -140,15 +140,15 @@ function requireNative() {
140
140
  }
141
141
  } else if (process.arch === 'ia32') {
142
142
  try {
143
- return require('./webview.win32-ia32-msvc.node')
143
+ return require('./webview-napi.win32-ia32-msvc.node')
144
144
  } catch (e) {
145
145
  loadErrors.push(e)
146
146
  }
147
147
  try {
148
148
  const binding = require('webview-napi-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('webview-napi-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -156,15 +156,15 @@ function requireNative() {
156
156
  }
157
157
  } else if (process.arch === 'arm64') {
158
158
  try {
159
- return require('./webview.win32-arm64-msvc.node')
159
+ return require('./webview-napi.win32-arm64-msvc.node')
160
160
  } catch (e) {
161
161
  loadErrors.push(e)
162
162
  }
163
163
  try {
164
164
  const binding = require('webview-napi-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('webview-napi-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -175,15 +175,15 @@ function requireNative() {
175
175
  }
176
176
  } else if (process.platform === 'darwin') {
177
177
  try {
178
- return require('./webview.darwin-universal.node')
178
+ return require('./webview-napi.darwin-universal.node')
179
179
  } catch (e) {
180
180
  loadErrors.push(e)
181
181
  }
182
182
  try {
183
183
  const binding = require('webview-napi-darwin-universal')
184
184
  const bindingPackageVersion = require('webview-napi-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -191,15 +191,15 @@ function requireNative() {
191
191
  }
192
192
  if (process.arch === 'x64') {
193
193
  try {
194
- return require('./webview.darwin-x64.node')
194
+ return require('./webview-napi.darwin-x64.node')
195
195
  } catch (e) {
196
196
  loadErrors.push(e)
197
197
  }
198
198
  try {
199
199
  const binding = require('webview-napi-darwin-x64')
200
200
  const bindingPackageVersion = require('webview-napi-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -207,15 +207,15 @@ function requireNative() {
207
207
  }
208
208
  } else if (process.arch === 'arm64') {
209
209
  try {
210
- return require('./webview.darwin-arm64.node')
210
+ return require('./webview-napi.darwin-arm64.node')
211
211
  } catch (e) {
212
212
  loadErrors.push(e)
213
213
  }
214
214
  try {
215
215
  const binding = require('webview-napi-darwin-arm64')
216
216
  const bindingPackageVersion = require('webview-napi-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -227,15 +227,15 @@ function requireNative() {
227
227
  } else if (process.platform === 'freebsd') {
228
228
  if (process.arch === 'x64') {
229
229
  try {
230
- return require('./webview.freebsd-x64.node')
230
+ return require('./webview-napi.freebsd-x64.node')
231
231
  } catch (e) {
232
232
  loadErrors.push(e)
233
233
  }
234
234
  try {
235
235
  const binding = require('webview-napi-freebsd-x64')
236
236
  const bindingPackageVersion = require('webview-napi-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -243,15 +243,15 @@ function requireNative() {
243
243
  }
244
244
  } else if (process.arch === 'arm64') {
245
245
  try {
246
- return require('./webview.freebsd-arm64.node')
246
+ return require('./webview-napi.freebsd-arm64.node')
247
247
  } catch (e) {
248
248
  loadErrors.push(e)
249
249
  }
250
250
  try {
251
251
  const binding = require('webview-napi-freebsd-arm64')
252
252
  const bindingPackageVersion = require('webview-napi-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -264,15 +264,15 @@ function requireNative() {
264
264
  if (process.arch === 'x64') {
265
265
  if (isMusl()) {
266
266
  try {
267
- return require('./webview.linux-x64-musl.node')
267
+ return require('./webview-napi.linux-x64-musl.node')
268
268
  } catch (e) {
269
269
  loadErrors.push(e)
270
270
  }
271
271
  try {
272
272
  const binding = require('webview-napi-linux-x64-musl')
273
273
  const bindingPackageVersion = require('webview-napi-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -280,15 +280,15 @@ function requireNative() {
280
280
  }
281
281
  } else {
282
282
  try {
283
- return require('./webview.linux-x64-gnu.node')
283
+ return require('./webview-napi.linux-x64-gnu.node')
284
284
  } catch (e) {
285
285
  loadErrors.push(e)
286
286
  }
287
287
  try {
288
288
  const binding = require('webview-napi-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('webview-napi-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -298,15 +298,15 @@ function requireNative() {
298
298
  } else if (process.arch === 'arm64') {
299
299
  if (isMusl()) {
300
300
  try {
301
- return require('./webview.linux-arm64-musl.node')
301
+ return require('./webview-napi.linux-arm64-musl.node')
302
302
  } catch (e) {
303
303
  loadErrors.push(e)
304
304
  }
305
305
  try {
306
306
  const binding = require('webview-napi-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('webview-napi-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -314,15 +314,15 @@ function requireNative() {
314
314
  }
315
315
  } else {
316
316
  try {
317
- return require('./webview.linux-arm64-gnu.node')
317
+ return require('./webview-napi.linux-arm64-gnu.node')
318
318
  } catch (e) {
319
319
  loadErrors.push(e)
320
320
  }
321
321
  try {
322
322
  const binding = require('webview-napi-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('webview-napi-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -332,15 +332,15 @@ function requireNative() {
332
332
  } else if (process.arch === 'arm') {
333
333
  if (isMusl()) {
334
334
  try {
335
- return require('./webview.linux-arm-musleabihf.node')
335
+ return require('./webview-napi.linux-arm-musleabihf.node')
336
336
  } catch (e) {
337
337
  loadErrors.push(e)
338
338
  }
339
339
  try {
340
340
  const binding = require('webview-napi-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('webview-napi-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -348,15 +348,15 @@ function requireNative() {
348
348
  }
349
349
  } else {
350
350
  try {
351
- return require('./webview.linux-arm-gnueabihf.node')
351
+ return require('./webview-napi.linux-arm-gnueabihf.node')
352
352
  } catch (e) {
353
353
  loadErrors.push(e)
354
354
  }
355
355
  try {
356
356
  const binding = require('webview-napi-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('webview-napi-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -366,15 +366,15 @@ function requireNative() {
366
366
  } else if (process.arch === 'loong64') {
367
367
  if (isMusl()) {
368
368
  try {
369
- return require('./webview.linux-loong64-musl.node')
369
+ return require('./webview-napi.linux-loong64-musl.node')
370
370
  } catch (e) {
371
371
  loadErrors.push(e)
372
372
  }
373
373
  try {
374
374
  const binding = require('webview-napi-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('webview-napi-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -382,15 +382,15 @@ function requireNative() {
382
382
  }
383
383
  } else {
384
384
  try {
385
- return require('./webview.linux-loong64-gnu.node')
385
+ return require('./webview-napi.linux-loong64-gnu.node')
386
386
  } catch (e) {
387
387
  loadErrors.push(e)
388
388
  }
389
389
  try {
390
390
  const binding = require('webview-napi-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('webview-napi-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -400,15 +400,15 @@ function requireNative() {
400
400
  } else if (process.arch === 'riscv64') {
401
401
  if (isMusl()) {
402
402
  try {
403
- return require('./webview.linux-riscv64-musl.node')
403
+ return require('./webview-napi.linux-riscv64-musl.node')
404
404
  } catch (e) {
405
405
  loadErrors.push(e)
406
406
  }
407
407
  try {
408
408
  const binding = require('webview-napi-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('webview-napi-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -416,15 +416,15 @@ function requireNative() {
416
416
  }
417
417
  } else {
418
418
  try {
419
- return require('./webview.linux-riscv64-gnu.node')
419
+ return require('./webview-napi.linux-riscv64-gnu.node')
420
420
  } catch (e) {
421
421
  loadErrors.push(e)
422
422
  }
423
423
  try {
424
424
  const binding = require('webview-napi-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('webview-napi-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -433,15 +433,15 @@ function requireNative() {
433
433
  }
434
434
  } else if (process.arch === 'ppc64') {
435
435
  try {
436
- return require('./webview.linux-ppc64-gnu.node')
436
+ return require('./webview-napi.linux-ppc64-gnu.node')
437
437
  } catch (e) {
438
438
  loadErrors.push(e)
439
439
  }
440
440
  try {
441
441
  const binding = require('webview-napi-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('webview-napi-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -449,15 +449,15 @@ function requireNative() {
449
449
  }
450
450
  } else if (process.arch === 's390x') {
451
451
  try {
452
- return require('./webview.linux-s390x-gnu.node')
452
+ return require('./webview-napi.linux-s390x-gnu.node')
453
453
  } catch (e) {
454
454
  loadErrors.push(e)
455
455
  }
456
456
  try {
457
457
  const binding = require('webview-napi-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('webview-napi-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -469,15 +469,15 @@ function requireNative() {
469
469
  } else if (process.platform === 'openharmony') {
470
470
  if (process.arch === 'arm64') {
471
471
  try {
472
- return require('./webview.openharmony-arm64.node')
472
+ return require('./webview-napi.openharmony-arm64.node')
473
473
  } catch (e) {
474
474
  loadErrors.push(e)
475
475
  }
476
476
  try {
477
477
  const binding = require('webview-napi-openharmony-arm64')
478
478
  const bindingPackageVersion = require('webview-napi-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -485,15 +485,15 @@ function requireNative() {
485
485
  }
486
486
  } else if (process.arch === 'x64') {
487
487
  try {
488
- return require('./webview.openharmony-x64.node')
488
+ return require('./webview-napi.openharmony-x64.node')
489
489
  } catch (e) {
490
490
  loadErrors.push(e)
491
491
  }
492
492
  try {
493
493
  const binding = require('webview-napi-openharmony-x64')
494
494
  const bindingPackageVersion = require('webview-napi-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -501,15 +501,15 @@ function requireNative() {
501
501
  }
502
502
  } else if (process.arch === 'arm') {
503
503
  try {
504
- return require('./webview.openharmony-arm.node')
504
+ return require('./webview-napi.openharmony-arm.node')
505
505
  } catch (e) {
506
506
  loadErrors.push(e)
507
507
  }
508
508
  try {
509
509
  const binding = require('webview-napi-openharmony-arm')
510
510
  const bindingPackageVersion = require('webview-napi-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '0.1.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 0.1.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.1.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.1.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -529,7 +529,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
529
529
  let wasiBinding = null
530
530
  let wasiBindingError = null
531
531
  try {
532
- wasiBinding = require('./webview.wasi.cjs')
532
+ wasiBinding = require('./webview-napi.wasi.cjs')
533
533
  nativeBinding = wasiBinding
534
534
  } catch (err) {
535
535
  if (process.env.NAPI_RS_FORCE_WASI) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webview-napi",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Robust cross-platform webview library for Node.js written in Rust. It also works with deno and bun.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "*.node"
22
22
  ],
23
23
  "napi": {
24
- "binaryName": "webview",
24
+ "binaryName": "webview-napi",
25
25
  "targets": [
26
26
  "x86_64-pc-windows-msvc",
27
27
  "i686-pc-windows-msvc",
@@ -101,4 +101,4 @@
101
101
  "useTabs": false
102
102
  },
103
103
  "packageManager": "bun@1.3.5"
104
- }
104
+ }
Binary file
Binary file
Binary file
Binary file
Binary file