iohook icon indicating copy to clipboard operation
iohook copied to clipboard

fix: 'non-context-aware' error for Electron

Open xiewh7 opened this issue 3 years ago • 6 comments
trafficstars

fix: 'non-context-aware' error for Electron

Description

The latest releases of Electron prevent "non-context-aware" native modules. By Replacing NODE_MODULE with NAN_MODULE_WORKER_ENABLED this fixes the errors for Electron.

xiewh7 avatar Mar 04 '22 11:03 xiewh7

The problem is lack of cleanup, doing location.reload() or advancing to any different html page crashes, and doing iohook.unload() often crashes.

marcelblum avatar Mar 06 '22 05:03 marcelblum

You can see my experiments towards this end at https://github.com/marcelblum/iohook but I didn't get very far and ended up needing to use Electron pre-v14 anyway.

marcelblum avatar Mar 06 '22 05:03 marcelblum

@marcelblum But we need to use Electron V16. How can we fix this problem in Electron after-v14?

xiewh7 avatar Mar 06 '22 05:03 xiewh7

I'm not sure, I probably don't have the c++ expertise to solve this, but like I said you can see what progress I made towards it in my fork. If you don't ever need to do a reload() or load a different html page in the same renderer BrowserWindow then the problem can probably be ignored...

marcelblum avatar Mar 06 '22 06:03 marcelblum

@WilixLead / @Djiit Can you help with the above PR? I am not familiar with C++, to help out. It would be great though if we can get this working again. Electron is currently at version 21.

sonukapoor avatar Dec 28 '22 17:12 sonukapoor

Hi is this still a relevant change? We can merge it if so.

lacymorrow avatar Jan 11 '24 17:01 lacymorrow