Open benbucksch opened 3 months ago
(The correct step 4 is to click on Posteingang.)
Right, clicking on INBOX = the folder, not the account, yes.
Note that regular OWA won't let you stay logged in after a restart; this feature is limited to the "Stay Logged In" option of Office 365.
regular OWA won't let you stay logged in after a restart
How would OWA know about a restart? Are you saying that these are session cookies? Can we tell the browser to make them persistent cookies?
Of course they're session cookies. They've always been session cookies. We looked at this in Owl five years ago, but nothing ever came of it, presumably because its auto-login content script was good enough. But there's some code on GitHub that might work. (I say might because it assumes there's only one partition and that you have somewhere to control adding the cookie listener.)
So, in Owl, with OWA, we:
In combination, that saves the user from having to log in manually, in many cases. So, we need the same in Mustang, for the login at startup to work.
Use the Owl source code to implement this.
Do background login, by submitting the login form directly in the background, without UI - esp. for on-premise Exchange with standard login form
This is already implemented by Neil on neil/owa-login-in-background
but not working as it yet doesn't detect any forms.
For Office365 and similar login forms, we open the window, but fill in the email address and password automatically.
This is already implemented by Neil on neil/owa-fill-login-window
but it doesn't for personal accounts.
Do background login, by submitting the login form directly in the background, without UI - esp. for on-premise Exchange with standard login form
This is already implemented by Neil on
neil/owa-login-in-background
but not working as it yet doesn't detect any forms.
I just tried it again and it worked first time for me with the ben@bexchange.net
account. It's known not to work with Office 365 accounts though, which is why we have the fill-login-window code..
For Office365 and similar login forms, we open the window, but fill in the email address and password automatically.
This is already implemented by Neil on
neil/owa-fill-login-window
but it doesn't for personal accounts.
There are at least three issues regarding personal accounts as compared to Office 365 accounts:
I can't find any way of getting any change to the password to stick. If you programmatically change the value, the page will reset it after most DOM events e.g. focus, mouseover. I've tried dispatching input events but without success.
I just found the following code for changing the password and not having it reset after DOM events. link here
const textToType = "testemail@email.com";
var element = document.querySelector('form input');
//gets the value property setter from the original HTMLInputElement
var originalValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;
//invokes the original setter over the specific element
originalValueSetter.call(element, textToType);
//fires the change event on the input element
element.dispatchEvent(new Event('change', { bubbles: true }));
//clicks the continue button...
document.querySelector('button.email-submit-button').click();
originalValueSetter = Object.getOwnPropertyDescriptor()
:laughing: Nice idea!
Thanks, that works! I've updated my branch with the working code.
I've merged neil/owa-login-in-background to master, with changes, e.g. moving the login form code into a separate file.
Thanks, @NeilRashbrook !
I've also merged neil/owa-fill-login-window to master, with changes, e.g. moving to a new file, and putting the script into a proper function, instead of a big string.
git commit 81ae4807
The problem there is that you're not quoting the substitutions any more, so if the password contains a "
then the script will break.
Indeed, thanks for the info. Which chars do we need to escape for a ""
string in JS? Only "
? Which function do you recommend? Do you want to make a PR to fix it?
Or should we use
`$PASSWORD`
and then escape
`
with its hex code \HH
?
Reproduction
Actual result
Expected result