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

"Error: Opening a new window is forbidden" when clicking links #285

Closed
CorruptComputer opened this issue Apr 26, 2020 · 6 comments
Closed
Labels

Comments

@CorruptComputer
Copy link

Sometimes when clicking links in emails I get the following error:
image

Unhandled Error
Error: Opening a new window is forbidden, url: "https://rt.linuxfoundation.org/"
    at notifyLogAndThrow (C:/Program Files/ElectronMail/resources/app.asar/app/electron-main.js:6466:19)
    at WebContents.<anonymous> (C:/Program Files/ElectronMail/resources/app.asar/app/electron-main.js:6479:13)

Clicking it again it usually goes away and works fine, but I'm not sure what the cause is.

@vladimiry
Copy link
Owner

vladimiry commented Apr 26, 2020

The error message you see is a result of additional security check took place (preventing opening new app windows). Normally it should not happen but some links are tricky to intercept the clicking of. So the reason for the issue is that the link clicking interception logic implemented in the app has room for improvement.

@vladimiry vladimiry added the bug label Apr 26, 2020
@vladimiry
Copy link
Owner

I thing the simple to implement solution for this issue would be in opening an the link as external / in-browser instead of raising the error.

@CorruptComputer
Copy link
Author

I just figured out an easy way to cause it on every click. If you middle-click (to open in a new tab) it will cause this.

I have a habit of doing this when on the web, so this may have just been user error sometimes with muscle memory doing middle-click on the links instead of left-click.

@vladimiry
Copy link
Owner

vladimiry commented Apr 26, 2020

This is a good finding. I can easily reproduce the error doing middle button click. So adding a middle click handler plus the change from my previous message should resolve the issue.

vladimiry added a commit that referenced this issue Apr 26, 2020
* so middle click on https/http links will lead to opening the url in a default browser (same behavior as primary button clicking)
@vladimiry
Copy link
Owner

The fix has been implemented and will be included in the next release.

@CorruptComputer
Copy link
Author

Amazing, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants