Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Latest Electron #241

Closed
orfeas05 opened this issue Jun 30, 2020 · 23 comments
Closed

Support for Latest Electron #241

orfeas05 opened this issue Jun 30, 2020 · 23 comments
Labels
bug An identified bug, though not necessarily being currently investigated electron Electron-related issues, bugs or questions help Actively soliciting contributions to help complete this work

Comments

@orfeas05
Copy link

Is there any plan on making iohook compatible with the latest Electron?

I really liked using it but now I'm forced to use the newest Electron version and everything feels off without iohook.

Thanks in advance,
Orfeas.

@marcelblum
Copy link
Contributor

+1. Happy to throw some donation $$ to the maintainers if that would help make a difference @Djiit ...

@Djiit
Copy link
Collaborator

Djiit commented Jun 30, 2020

Nah, just didn't had time. I'll do this tonight.

@marcelblum
Copy link
Contributor

whoah sweet thanks!

@orfeas05
Copy link
Author

that just made my day <3

@marcelblum
Copy link
Contributor

really hoping that maybe kwhat/libuiohook#72 fixes nasty #93

@Djiit
Copy link
Collaborator

Djiit commented Jun 30, 2020

It should be ok with 0.6.6, can you test it ?

@defano
Copy link

defano commented Jun 30, 2020

Thanks, @Djiit !

Added 0.6.6 to my project using Electron 80 (v9.0.5) but I get this crash immediately on launch (macOS Catalina):

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 iohook.node 0x000000010dc997af Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) + 31 1 com.github.Electron.framework 0x00000001034783ef v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 16815 2 com.github.Electron.framework 0x0000000103477911 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 14033 3 com.github.Electron.framework 0x0000000103476fa2 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) + 11618 4 com.github.Electron.framework 0x0000000103ea9d78 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 484168

No issues running 0.6.5 with Electron 8.2.0 (76)

@ykhwong
Copy link
Contributor

ykhwong commented Jul 1, 2020

I am having the same issue as above on Windows 10 x64. (Electron 80 : v9.0.5)
It terminates immediately upon require('iohook').

@Djiit
Copy link
Collaborator

Djiit commented Jul 1, 2020

Hu, ok, I have the same. I'll revert the change to make sure nobody try to use it. I'm really sorry but don't have time to work on this right now. Any help would be more than welcome.

@Djiit Djiit added bug An identified bug, though not necessarily being currently investigated electron Electron-related issues, bugs or questions help Actively soliciting contributions to help complete this work labels Jul 1, 2020
@Djiit
Copy link
Collaborator

Djiit commented Jul 1, 2020

nvm, the version is still OK with older versions. I'll just make it bold in the readme that we need help to support newer versions.

@marcelblum
Copy link
Contributor

Same here, Windows 10. Simple test using https://github.com/electron/electron-quick-start and installing iohook, adding app.allowRendererProcessReuse = false and webPreferences: {nodeIntegration: true} to main.js, calling require('iohook') from the renderer crashes that process. However I am able to use this new version 0.6.6 with Electron 8.3.4 (electron-76) just fine. #93 is still a problem.

@napalm00
Copy link

I was able to compile iohook on Windows 10 x64 for Electron v9.2.0 using node-gyp and it works properly, somehow compiling with cmake-js makes it crash as soon as a method call is executed (e.g NodeHookAddon.startHook) with no error printed to the console.

@ykhwong
Copy link
Contributor

ykhwong commented Aug 17, 2020

I was able to compile iohook on Windows 10 x64 for Electron v9.2.0 using node-gyp and it works properly, somehow compiling with cmake-js makes it crash as soon as a method call is executed (e.g NodeHookAddon.startHook) with no error printed to the console.

Thanks, it's working fine with the node-gyp.

@renzner
Copy link

renzner commented Sep 10, 2020

I was able to compile iohook on Windows 10 x64 for Electron v9.2.0 using node-gyp and it works properly, somehow compiling with cmake-js makes it crash as soon as a method call is executed (e.g NodeHookAddon.startHook) with no error printed to the console.

Dumb question here. How did you compile it using node-gyp?

@ykhwong
Copy link
Contributor

ykhwong commented Sep 10, 2020

I was able to compile iohook on Windows 10 x64 for Electron v9.2.0 using node-gyp and it works properly, somehow compiling with cmake-js makes it crash as soon as a method call is executed (e.g NodeHookAddon.startHook) with no error printed to the console.

Dumb question here. How did you compile it using node-gyp?

I created the following files binding.gyp and uiohook.gyp before running the node-gyp to compile the iohook.

binding.gyp

{
	"targets": [{
		"target_name": "iohook",
		"win_delay_load_hook": "true",
		"type": "shared_library",
		"sources": [
			"src/iohook.cc",
			"src/iohook.h"
		],
		"dependencies": [
			"./uiohook.gyp:uiohook"
		],
		"include_dirs": [
			"<!(node -e \"require('nan')\")",
			"libuiohook/include"
		],
		"configurations": {
			"Release": {
				"msvs_settings": {
					"VCCLCompilerTool": {
						'ExceptionHandling': 1
					}
				}
			}
		}
	}]
}

uiohook.gyp

{
	"targets": [{
		"target_name": "uiohook",
		"type": "shared_library",
		"sources": [
			"libuiohook/include/uiohook.h",
			"libuiohook/src/logger.c",
			"libuiohook/src/logger.h",
			"libuiohook/src/windows/input_helper.h",
			"libuiohook/src/windows/input_helper.c",
			"libuiohook/src/windows/input_hook.c",
			"libuiohook/src/windows/post_event.c",
			"libuiohook/src/windows/system_properties.c"
		],
		"include_dirs": [
			'node_modules/nan',
			'libuiohook/include',
			'libuiohook/src'
		]
	}]
}

Build

node-gyp configure build --target=9.2.0 --arch=x64 --dist-url=https://atom.io/download/electron

@renzner
Copy link

renzner commented Sep 14, 2020

Thanks :) I'll try this one.

@Djiit
Copy link
Collaborator

Djiit commented Oct 5, 2020

Hey @ykhwong , would you be interested in opening a PR that introduce node-gyp usage ? It could help us to support Electron 9 and 10 (and other versions).

Thanks!

@BhuvanRohith
Copy link

Any update on this. It would be really helpful for electron 9 and 10 versions.

@BhuvanRohith
Copy link

Thanks :) I'll try this one.
Hey @renzner , were you able to successfully do a gyp build ?

@ykhwong
Copy link
Contributor

ykhwong commented Nov 5, 2020

Hey @ykhwong , would you be interested in opening a PR that introduce node-gyp usage ? It could help us to support Electron 9 and 10 (and other versions).

I opened a pull request at #258
Please consider removing CMakeLists.txt and cmake-js in package.json.

@renzner
Copy link

renzner commented Nov 6, 2020

Thanks :) I'll try this one.
Hey @renzner , were you able to successfully do a gyp build ?

Looks complicated to me. So I ended up downgrading my electron version :)

@Djiit
Copy link
Collaborator

Djiit commented Nov 6, 2020

Hey @ykhwong , many thanks ! I'll review this over the weekend.

@ash0x0
Copy link
Collaborator

ash0x0 commented Jun 11, 2021

Closing as resolved.

@ash0x0 ash0x0 closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An identified bug, though not necessarily being currently investigated electron Electron-related issues, bugs or questions help Actively soliciting contributions to help complete this work
Projects
None yet
Development

No branches or pull requests

9 participants