julian-alarcon / prospect-mail

Prospect is an Outlook mail desktop client powered by Electron
MIT License
459 stars 66 forks source link

[Feature Request]: choose nodeIntegration value in settings #312

Open niconil opened 1 year ago

niconil commented 1 year ago

Is your feature request related to a problem? Please describe. my enterprise auth page uses JQuery when i launch prospect-mail the auth page is not loading correctly and i'm unable to logging in

when launch prospect-mail with --enable-logging it's clear it's a problem related to jquery [44559:1107/140954.990131:INFO:CONSOLE(6)] "Uncaught ReferenceError: jQuery is not defined"

i've found two useful ressources about issue with Electron and JQuery :

directly from the electronjs FAQ, I apply the following recommandation : "To solve this, you can turn off node integration in Electron"

so in "src/controller/mail-window-controller.js" (line 94) i change the value of 'nodeIntegration' from 'true' to 'false'

and my local instance of prospect-mail is working !! i see no evident bad effect after few minutes of use.

Describe the solution you'd like I'm not very familiar with Electron, i not aware of the consequences of my change if prospect-mail can work correctly with nodeIntegration set to false, is it possible to set the wanted value of nodeIntegration in settings file ?

Describe alternatives you've considered without this change i'm unable to use prospect mail

zeitounator commented 10 months ago

I was following #299 but this is a more generic description of the overall problem. Having a look, I think that #316, #311 and probably #303 are duplicate of this same overall problem.

As far as I'm concerned, checking out #314 and storing the following new implemented setting in my ~/.config/Prospect Mail/settings.json file fixes the issue (i.e. getting directed to my company saml login and correctly following all redirection untill login is successful):

{
  "contextIsolation": true
}

This setting should probably be the default value as this is the case anyway if you don't provide this value when creating a BrowserWindow instance.

zeitounator commented 10 months ago

Since this is currently striking me only every now and then when I have to rotate my password and that the latest version works correctly once authenticated, here is how I work around the problem using the snap version for whomever it might help until the above is merged.

  1. Download v0.4.0 snap version.
  2. Make sure the latest snap installed version is stopped. Roll back to the oldest version
    sudo snap install --dangerous /path/to/downloaded/prospect-mail_0.4.0_amd64.snap
  3. Login through your saml corportate page. Once done exit prospect mail
  4. Roll forward to the latest snap plublished version:
    sudo snap refresh prospect-mail --amend
  5. Start prospect mail again. You should be already logged in and running the latest version.