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

Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab #369

Closed
3 tasks done
jasonblais opened this issue Nov 22, 2016 · 12 comments

Comments

@jasonblais
Copy link
Contributor

jasonblais commented Nov 22, 2016

I confirm (by marking "x" in the [ ] below):


Jira ticket: https://mattermost.atlassian.net/browse/MM-14108

Summary

Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab

Steps to reproduce

SCENARIO 1

Environment:

  • Windows 7 / Mattermost Server v3.4.0 / Mattermost Desktop App v3.4.1

Repro steps:

  1. In a Mattermost channel, post http://www.theverge.com/2016/11/15/13635788/apple-coffee-table-book-products-images
  2. Click the link

--

SCENARIO 2

Environment:

  • Windows 7 and 10, Mac OS X / Mattermost Server v3.6.0 / Mattermost Desktop App v3.5.0

Repro steps:

  1. Go to Account Settings > Advanced > Prevew pre-release features
  2. Select Show experimental previews of link content, when available
  3. Hit "Save"
  4. In a Mattermost channel, post https://www.flickr.com/photos/spacex/31579784413/
  5. Click the image preview

Expected behavior

A new browser window opens for the web page you clicked

Observed behavior

Page renders inside the app. There is no way to go back to the app unless you restart it.

image

Possible fixes

?

@jasonblais jasonblais added this to the v3.6.0 milestone Nov 22, 2016
@jasonblais jasonblais added the Hackfest null label Dec 7, 2016
@jasonblais jasonblais removed the Hackfest null label Jan 9, 2017
@yuya-oc
Copy link
Contributor

yuya-oc commented Jan 12, 2017

I could not reproduce that in the combination: Windows 7 / Mattermost Server v3.4.0 / Mattermost Desktop App v3.4.1 and also on desktop app v3.5.0. I feel the link was unexpectedly rendered as a simple <a> tag without target attribute on webapp.

In some cases like SSO, external pages should be opened in the app. So I would not be able to restrict the behavior by using hostname.

@jasonblais
Copy link
Contributor Author

I feel the link was unexpectedly rendered as a simple tag without target attribute on webapp.

Would there be post formatting that would lead to this, would you know?

@yuya-oc
Copy link
Contributor

yuya-oc commented Jan 14, 2017

Unfortunately no. FYI, I tried two cases, typing URL and using markdown link.

@jasonblais jasonblais removed this from the v3.6.0 milestone Jan 14, 2017
@jasonblais
Copy link
Contributor Author

Sounds good, we haven't reproduced it in 3.5 yet, so I'll add 'more information needed' label for now.

The original submitter mentioned it occurs randomly, so if they can't reproduce it in 3.5 I'll close the issue

@jasonblais jasonblais changed the title Windows 7: Clicking some links render the page inside the app instead of in a new browser tab Windows 7: Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Jan 18, 2017
@jasonblais
Copy link
Contributor Author

@yuya-oc added new repro steps for a second scenario:

Repro steps:

  1. Go to Account Settings > Advanced > Prevew pre-release features
  2. Select Show experimental previews of link content, when available
  3. Hit "Save"
  4. In a Mattermost channel, post https://www.flickr.com/photos/spacex/31579784413/
  5. Click the image preview

@jasonblais
Copy link
Contributor Author

^I was able to consistently reproduce this in Windows 10; the report came from Windows 7

@jasonblais jasonblais changed the title Windows 7: Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Jan 18, 2017
@yuya-oc
Copy link
Contributor

yuya-oc commented Jan 19, 2017

Thanks! In the second scenario, the image has <a> tag without target="_blank" attribute in webapp. So the link is opened in the main window. Chrome also has this behavior, but it would not matter because browsers have back button.

To fix this, probably we can take two approaches.

  1. the main window subscribes an event. If the target URL is outside of the server URL, open it with default web browser. (Exception: If the current URL is the login page, the link should be opened in the main window in order to use SSO. e.g. GitLab SSO)
  2. webapp creates <a> tag with target="_blank", I'm not sure how webapp generates a preview though.

@jasonblais
Copy link
Contributor Author

We actually just merged a new version for website link previews where we use OpenGraph data instead: mattermost/mattermost#4890

This changes the behaviour a little where images aren't clickable --> and hence they probably don't have the <a> tag associated with them.

From your viewpoint, I'm not sure if that might resolve the issues here?

@yuya-oc
Copy link
Contributor

yuya-oc commented Jan 23, 2017

Yeah, the approach seems to solve this problem. In future, the approach 1.) would be the fundamental measure though.

@jasonblais
Copy link
Contributor Author

Would we need to whitelist which login URLs we'd support?

A server running SAML might set up a custom IDP depending on which provider they want to use (hence, the login pages might be different)

@jasonblais jasonblais changed the title Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab [Help Wanted] Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Feb 26, 2017
@jasonblais jasonblais changed the title [Help Wanted] Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Mar 22, 2017
@jasonblais jasonblais added this to the Backlog (Unscheduled) milestone Mar 22, 2017
@jasonblais jasonblais modified the milestones: v3.10.0, Unscheduled May 12, 2017
@jasonblais jasonblais removed the Hacktoberfest null label Nov 3, 2017
@amyblais amyblais removed this from the v4.2.0 milestone Mar 21, 2018
@amyblais amyblais added the Hackfest null label Jan 25, 2019
@amyblais
Copy link
Member

@amyblais amyblais changed the title Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab [Help Wanted] Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Feb 27, 2019
@amyblais amyblais removed the Hackfest null label Mar 1, 2019
@amyblais amyblais added the Hacktoberfest null label Oct 7, 2019
@hanzei hanzei changed the title [Help Wanted] Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Clicking some links, or images in link previews, render the page inside the app instead of in a new browser tab Oct 22, 2019
@amyblais amyblais removed the Hacktoberfest null label Nov 4, 2019
@esethna
Copy link
Contributor

esethna commented Mar 25, 2020

No longer valid

@esethna esethna closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants