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

Links open inside Prospect Mail window, instead of a browser #240

Closed
SeppoTakalo opened this issue Jul 28, 2022 · 31 comments
Closed

Links open inside Prospect Mail window, instead of a browser #240

SeppoTakalo opened this issue Jul 28, 2022 · 31 comments

Comments

@SeppoTakalo
Copy link

There has been some changes apparently in Outlook Web, as Prospect Mail have not changed.

This week, I started to notice that when ever I try to click any link inside the email, it opens up inside Prospect Mail window. And because there is no navigation buttons, I cannot anymore get back to my email.

@murturn
Copy link

murturn commented Aug 3, 2022

I see the same. Using the navigation buttons on the side of my mouse does work to return to the mailbox, but no other way is available as far as I can tell.

@PocketSam
Copy link

PocketSam commented Sep 18, 2022

Did someone find a way to fix this?

@keirak420
Copy link

keirak420 commented Sep 20, 2022

This does not appear to be a "Prospect Mail" issue but rather SnapCraft. I copied the repo, compiled the Debian version, and installed it through the OS. It now appears to be working normally for me. I opted to use https://github.com/kemoycampbell/prospect-mail instead as he has incorporated a "right" mouse click menu that allows you to copy links as well but I did test both.

Test it out, uninstall the SnapCraft version compile your Linux distro version, and try that way. Hopefully, this works for you guys as well. Good luck.

CORRECTION:
I just realized that I didn't have my "settings.json" configured. Upon setting it, now it defaults to the internal browser. I am still troubleshooting this but it does appear to be something with the following settings:

{
    "urlMainWindow":"https://outlook.live.com/mail",
    "urlsInternal":["outlook.com", "live.com"],
    "urlsExternal":["outlook.com", "live.com"]
}

@keirak420
Copy link

keirak420 commented Sep 20, 2022

Ok, so I just reinstalled the SnapCraft version, and changed these lines:

{
    "urlMainWindow":"https://outlook.live.com/mail",
    "urlsInternal":["outlook.com", "live.com"],
    "urlsExternal":["outlook.com", "live.com"]
}

to:

{
    "urlMainWindow":"https://outlook.live.com/mail"
}

I had to quit and restart Prospect Mail as reload didn't seem to change this behavior.
At least for now, the links are redirected to a browser, I am not sure how this will impact other links moving forward. Alternatively, use Kemoy Campbell's version as it at least allows you to right-mouse-click and copy.

Keira

@zeldigas
Copy link

I've tried solution from @keirak420 but it does not seem to work. From js logic all is fine, and exactly the branch that should open link in browser is executed, but in fact page is still opened inside prospect's window.

Here is the log that I can see, hope it can help identify issue. Maybe the root cause is ibus connectivity issue as I see some warning about it?

(prospect-mail:123655): Gtk-WARNING **: 17:54:16.798: Theme parsing error: gtk.css:3770:23: 'font-feature-settings' is not a valid property name
Loaded settings {
  outlookUrl: 'https://outlook.office.com/mail',
  deeplinkUrls: [
    'outlook.live.com/mail/deeplink',
    'outlook.office365.com/mail/deeplink',
    'outlook.office.com/mail/deeplink',
    'outlook.office.com/calendar/deeplink'
  ],
  outlookUrls: []
}
[123735:0920/175417.004319:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[123655:0920/175417.557710:ERROR:browser_main_loop.cc(269)] Gdk: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
initialMinimization.domReady false

(prospect-mail:123655): IBUS-WARNING **: 17:54:18.914: Unable to connect to ibus: Could not connect: Connection refused
Open in browser: https://outlook.office.com/mail/safelink.html?....(long url here from email, that should be really matter)

@chahatupreti
Copy link

Any update on this?

@DenisBY
Copy link

DenisBY commented Sep 28, 2022

I had to switch to Freelook because of this and Freelook doesn't have this issue.

@adimitr
Copy link

adimitr commented Nov 8, 2022

Just confirming that I also see the issue, but started seeing it maybe a month ago or so. Not sure why it manifested later than the rest of you. Thanks for the posts. I will try some of the configurations suggested here.

Update: I experimented with the proposed setting and noted that having just
"urlsExternal":["outlook.com", "live.com"]
in the settings.json lead to the desired behavior: external links open in my default browser; internal links, like Calendar, open in a Prospect Mail window. Adding the "urlsExternal" setting caused Calendar changes to also open in the browser window, which worked but was annoying to me.

Cheers

@negesti
Copy link

negesti commented Dec 23, 2022

Seeing the same problem, the logs shows "opening in browser" but the link is openend inside Prospect Mail :(


Open in browser: https://outlook.office.com/mail/safelink.html?url=<damnLongUrlNobodyCanRead>

@paulquevedojdrf
Copy link

paulquevedojdrf commented Jan 16, 2023

This started happening to me because my company enabled some outlook safelink policy thing which directs all links through https://outlook.office.com/mail/safelink.html?url=<your link>
Given that the common URL prefix https://outlook.office.com/mail is the same to all other internal outlook links, I don't think this can be worked around via settings.json. The best you can do was explained here:

I think the regex logic for determining when to open links in a new window needs support for exclusion patterns.

  • I tried adding a negative regex pattern to settings.json but as expected that shouldn't work if electron-settings is doing its job.

openInBrowser(e, url, frameName, disposition, options) {
console.log('Open in browser: ' + url)//frameName,disposition,options)
if (new RegExp(deeplinkUrls.join('|')).test(url)) {
// Default action - if the user wants to open mail in a new window - let them.
//e.preventDefault()
console.log('Is deeplink')
options.webPreferences.affinity = 'main-window';
}
else if (new RegExp(outlookUrls.join('|')).test(url)) {
// Open calendar, contacts and tasks in the same window
e.preventDefault()
this.loadURL(url)
}
else {
// Send everything else to the browser
e.preventDefault()
shell.openExternal(url)
}
}

@pkeir
Copy link

pkeir commented Jan 18, 2023

I am also affected by this. Whenever I click on a link, it opens within Prospect Mail. I am then unable to return to Prospect Mail. My best option is then to close Prospect Mail, and click "Quit" via right-click on the unwanted Prospect Mail icon at the top bar of Gnome (Ubuntu).

Is there perhaps a keyboard shortcut for "Back" (previous page), which might already be available?

@dmdalmas
Copy link

Best work around I have found is to alt+F4 the prospect-mail window and relaunch the program. This keeps prospect-mail running in the background but seems to reset the session and brings you back to mail.

@pkeir
Copy link

pkeir commented Jan 18, 2023

Thanks. I tried that, but bizarrely it seems I have to perform those actions twice before it works (using either ALT-F4 or the X at the top-right).

With the method I mentioned, I have now discovered that only the second part is required: right-click on the (otherwise) unwanted Prospect Mail icon at the top bar of Gnome (Ubuntu), and select: Quit. That both closes the window and resets the session.

@negesti
Copy link

negesti commented Jan 18, 2023

@pkeir Right click on the top bar icon does not work for my. In my case right click on the icon opens a context menu and enable/disable the checkbox "Window Frame" reloads the prospect mail session and i can access my mails again

@pkeir
Copy link

pkeir commented Jan 18, 2023

Nice. This does work for me, though I find on the menu that pops up from the top bar icon, the choice is Settings > Show Window Frame.

The only disadvantage is that with Show Window Frame being a toggle, the window then appears without a frame, and so cannot be moved by the mouse as usual.

@pkeir
Copy link

pkeir commented Feb 17, 2023

Links seem now to be opening correctly in the browser for me.

@micw
Copy link
Contributor

micw commented Feb 27, 2023

{
"urlMainWindow":"https://outlook.live.com/mail",
"urlsInternal":["outlook.com", "live.com"],
"urlsExternal":["outlook.com", "live.com"]
}

I wonder what the meaning of this setting is, it makes no sense to me. In the code, urlsInternal goes into the "deeplinkUrls" variable. "urlsExternal" goes to the "outlookUrls" variable. outlookUrls are always opened within the application's main window. For deeplinkUrls, the "default bahaviour" is used (I guess either the main window or a new application window).
All that does not match opens in an external browser.

I modified the code a bit locally to allow to force that some URLs are opened in an external browser. This way I can force "safelink.html" to be opened external although it matches the other domains which solves this issue for me. I will provide a PR for testing.

@pkeir
Copy link

pkeir commented Mar 10, 2023

Links seem now to be opening correctly in the browser for me.

I spoke too soon: YouTube, Github and OneDrive links (at least) are once again opening within Prospect Mail.

@kbuzzard
Copy link

Me too (on Ubuntu 20.04). The problem with the "click on top bar icon, quit and restart" is that then I lose my location in the middle of the hundreds of emails I'm trying to deal with. People suggested changing something in settings.json -- where is this file stored on an Ubuntu system? I seem to have installed it via Snap?

By the way, to confirm that this is a work account and now when I click on a link I get a "Verifying link..." page for a second or two, with "Powered by Office 365 Advanced Threat Protection" at the bottom.

Right now to work around this I've resorted to reading emails in a browser window, which is randomly awful for other reasons (I've had issues with emails being spontaneously deleted, for example; this doesn't happen for me with Prospect Mail).

@micw
Copy link
Contributor

micw commented Mar 22, 2023

can you give my PR #262 a try to check if it solves the issue for you?

@kbuzzard
Copy link

kbuzzard commented Mar 22, 2023

I'm afraid that I'm just using Prospect Mail via some package manager and am in no position to compile it myself. Icon click -> settings -> settings file just opens a random folder on my system called .config with e.g. some md5sum files in and a few directories.

Update: the directory is ~/snap/prospect-mail/22/.config and in the Prospect Mail subdirectory there's a settings.json file whose contents until 5 minutes ago just consisted of {}. I changed it to {"urlsExternal":["outlook.com", "live.com"]} and this didn't fix the problem, but for all I know my syntax is wrong.

Final update: I changed the contents of this file to

{
"urlMainWindow":"https://outlook.live.com/mail",
"urlsInternal":["outlook.com", "live.com"],
"urlsExternal":["outlook.com", "live.com"]
}

and this seems to have fixed the problem for me (I had to log in again). Thanks to the people who posted in this thread!

@jclsn
Copy link

jclsn commented Mar 27, 2023

Any way to force the links to be opened in Firefox?

@kbuzzard
Copy link

Oh this is a great question: I've noticed that right now in my set-up the links are being opened in a new window but with no browser buttons (so e.g. you can't go back if you click on a link)

@jclsn
Copy link

jclsn commented Apr 5, 2023

The workaround needs to be changed to

{
"urlMainWindow":"https://outlook.office.com/mail/",
"urlsInternal":["outlook.com", "live.com"],
"urlsExternal":["outlook.com", "live.com"]
}

now

@pkeir
Copy link

pkeir commented Jun 2, 2023

I tried the solution above. I edited $HOME/snap/prospect-mail/current/.config/Prospect Mail/settings.json as suggested. Now links open using a new Prospect Mail window (rather than your browser, with your browser settings).

It's certainly easier then to recover, but this is still not a proper fix.

@jclsn
Copy link

jclsn commented Jun 7, 2023

Yeah, there is another fix in a fork somewhere, but I was too lazy to build it myself.

Here: #262

Since the developer has abandoned this project, someone should maybe build it or create an AUR package

@areyesco
Copy link

The problem is in the sniped code by paulquevedojdrf, but understanding the code, you only need to modify the property "urlsExternal" in the settings.json file with a customer random array string, to overwrite the default value. My in case I add this value for "urlsExternal":

File settings.json
{
...
"urlsExternal": ["A"]
...
}

Close and reopen prospect mail, and now all the links are open in a new web browser window.

@kbuzzard
Copy link

This opens the links in a new window of some sort but I still don't get the browser navigation buttons such as a "back" button, and I'm not logged into things like github if I click on a github link.

@justinvson-pd
Copy link

Still doesn't work with latest main build for me, links still open inside prospect client

built and installed using snap.

Also changing settings.json does not seem to have effect on this, either by setting urlsExternal to a weird value or setting the other suggested values.

@julian-alarcon
Copy link
Owner

Please try again @justinvson-pd . You could use the beta channel of snap with version 0.5-beta1
sudo snap install prospect-mail --channel=beta

@micw
Copy link
Contributor

micw commented Sep 19, 2023

It should work. I run a build of that PR since I created it and had no single external link opened in the mail window.

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

No branches or pull requests