LukeSkywalker92 / TeleFrame

TeleFrame - a digital picture frame for telegram
MIT License
93 stars 28 forks source link

Not working in newer Electron versions #195

Closed dengesCU closed 1 year ago

dengesCU commented 1 year ago

Apologies for the quick and dirty report, I spend way too long trying to figure out why after updating my frame did not work anymore. But hopefully this might save someone else some time

Long story short (here is the URL that enlightened me: https://github.com/electron/electron-quick-start/issues/463) With Electron 12 and above 'contextIsolation' is set to true per default. So, when running the app the error 'uncaught reference require is not defined' (visible in the Developer Tools) occurs. As a result, when running the app, it is stuck on the splash screen and unresponsive to input.

Fix: Add 'contextIsolation: false' in main.js in line 42, i.e.

  win = new BrowserWindow({
    width: 1024,
    height: 600,
    webPreferences: {
      nodeIntegration: true,
      enableRemoteModule: true,
      contextIsolation: false
    },
  });

Disclaimer: I am not an expert in nodejs / electron whatsoever, and I don't know whether there is any security implications from doing this (my assumption is not since it all runs local).

dengesCU commented 1 year ago

Just found #188 (same problem and same conclusion as here), hence closing this issue.