node-mac-recorder 2.4.6 → 2.4.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.4.6",
3
+ "version": "2.4.7",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -974,12 +974,6 @@ bool hideScreenRecordingPreview() {
974
974
  Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
975
975
  Napi::Env env = info.Env();
976
976
 
977
- // Electron safety check - prevent crashes with overlay windows
978
- if (getenv("ELECTRON_VERSION") || getenv("ELECTRON_RUN_AS_NODE")) {
979
- NSLog(@"⚠️ Window selector disabled in Electron environment to prevent crashes");
980
- return Napi::Boolean::New(env, false);
981
- }
982
-
983
977
  if (g_isWindowSelecting) {
984
978
  NSLog(@"⚠️ Window selection already in progress");
985
979
  return Napi::Boolean::New(env, false);
@@ -1279,12 +1273,6 @@ Napi::Value GetWindowSelectionStatus(const Napi::CallbackInfo& info) {
1279
1273
  Napi::Value ShowRecordingPreview(const Napi::CallbackInfo& info) {
1280
1274
  Napi::Env env = info.Env();
1281
1275
 
1282
- // Electron safety check - prevent crashes with overlay windows
1283
- if (getenv("ELECTRON_VERSION") || getenv("ELECTRON_RUN_AS_NODE")) {
1284
- NSLog(@"⚠️ Recording preview disabled in Electron environment to prevent crashes");
1285
- return Napi::Boolean::New(env, false);
1286
- }
1287
-
1288
1276
  if (info.Length() < 1) {
1289
1277
  NSLog(@"⚠️ Window info object required");
1290
1278
  return Napi::Boolean::New(env, false);
@@ -1350,12 +1338,6 @@ Napi::Value HideRecordingPreview(const Napi::CallbackInfo& info) {
1350
1338
  Napi::Value StartScreenSelection(const Napi::CallbackInfo& info) {
1351
1339
  Napi::Env env = info.Env();
1352
1340
 
1353
- // Electron safety check - prevent crashes with overlay windows
1354
- if (getenv("ELECTRON_VERSION") || getenv("ELECTRON_RUN_AS_NODE")) {
1355
- NSLog(@"⚠️ Screen selector disabled in Electron environment to prevent crashes");
1356
- return Napi::Boolean::New(env, false);
1357
- }
1358
-
1359
1341
  @try {
1360
1342
  bool success = startScreenSelection();
1361
1343
  return Napi::Boolean::New(env, success);
@@ -33,13 +33,13 @@ class WindowSelector extends EventEmitter {
33
33
  this.selectedWindow = null;
34
34
  this.lastStatus = null;
35
35
 
36
- // Electron environment detection
36
+ // Electron environment detection (for logging only)
37
37
  this.isElectron = !!(process.versions && process.versions.electron) ||
38
38
  !!(process.env.ELECTRON_VERSION) ||
39
39
  !!(process.env.ELECTRON_RUN_AS_NODE);
40
40
 
41
41
  if (this.isElectron) {
42
- console.warn("⚠️ WindowSelector: Running in Electron - some features disabled to prevent crashes");
42
+ console.log("🔍 WindowSelector: Detected Electron environment");
43
43
  }
44
44
  }
45
45
 
@@ -49,10 +49,6 @@ class WindowSelector extends EventEmitter {
49
49
  * Select butonuna basılınca seçim tamamlanır
50
50
  */
51
51
  async startSelection() {
52
- if (this.isElectron) {
53
- throw new Error("Window selection is not supported in Electron environment due to stability issues");
54
- }
55
-
56
52
  if (this.isSelecting) {
57
53
  throw new Error("Window selection is already in progress");
58
54
  }
@@ -304,11 +300,6 @@ class WindowSelector extends EventEmitter {
304
300
  * @returns {Promise<boolean>} Success/failure
305
301
  */
306
302
  async showRecordingPreview(windowInfo) {
307
- if (this.isElectron) {
308
- console.warn("⚠️ Recording preview disabled in Electron environment");
309
- return false;
310
- }
311
-
312
303
  if (!windowInfo) {
313
304
  throw new Error("Window info is required");
314
305
  }
@@ -340,10 +331,6 @@ class WindowSelector extends EventEmitter {
340
331
  * @returns {Promise<boolean>} Success/failure
341
332
  */
342
333
  async startScreenSelection() {
343
- if (this.isElectron) {
344
- throw new Error("Screen selection is not supported in Electron environment due to stability issues");
345
- }
346
-
347
334
  try {
348
335
  const success = nativeBinding.startScreenSelection();
349
336
  if (success) {
@@ -456,11 +443,6 @@ class WindowSelector extends EventEmitter {
456
443
  * @returns {Promise<boolean>} Success/failure
457
444
  */
458
445
  async showScreenRecordingPreview(screenInfo) {
459
- if (this.isElectron) {
460
- console.warn("⚠️ Screen recording preview disabled in Electron environment");
461
- return false;
462
- }
463
-
464
446
  if (!screenInfo) {
465
447
  throw new Error("Screen info is required");
466
448
  }