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

Fix making and receiving calls #1325

Merged
merged 2 commits into from
Apr 7, 2020
Merged

Fix making and receiving calls #1325

merged 2 commits into from
Apr 7, 2020

Conversation

wereii
Copy link

@wereii wereii commented Apr 6, 2020

Workaround electron's location handling on new windows [window.open()]

Fixes #1189

I also described the full solution in my comment on the issue.

  • Doing newWindow.location = "/path" fails because at it seems, by default electron is trying to join the new-window's location (that window's window.location) with the new location (/path), but the new-window doesn't have valid location.href because it wasn't opened with one.
    w1 = window.open() // w1.location.href === "about:blank"
    In normal browser, as long as your new location is not valid URL on it's own (?) it would join the new path with current's window (the window from where you are opening the new-window) location, not the new-window's one.

Solution

  • When open of Group Calls window is detected, additionally pre-set the location to https://www.messenger.com.

@wereii
Copy link
Author

wereii commented Apr 6, 2020

Ah, after a bit more testing the first workaround is not reliable.
I was testing it by the "Join call" in a group, or after the call ends, there is a button to call others again, and this worked without problem, the calling window would fully load and the call would be started.
Forgot to try direct calling to someone or someone calling me and that isn't working, still fails with blank window and errors like
LocationProxy: failed to parse string TypeError: Failed to construct 'URL': Invalid URL.

Shifting back to nativeWindowOpen: true.

Edited for clarity.

@wereii wereii changed the title Workaround electron's location handling on new-windows. Workaround electron's location handling on new windows [window.open()] Apr 6, 2020
@CvX CvX changed the title Workaround electron's location handling on new windows [window.open()] Fix making and receiving calls Apr 7, 2020
@CvX
Copy link
Collaborator

CvX commented Apr 7, 2020

Tried it, and I could successfully call someone, end the call and redial within the call window, and was able to answer a call. Great work! 😊 🚀

@CvX CvX merged commit b69ed37 into sindresorhus:master Apr 7, 2020
@CvX
Copy link
Collaborator

CvX commented Apr 7, 2020

Released in 2.45.0

@wereii wereii deleted the calls-fix branch April 9, 2020 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calls not working
2 participants