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

Slack: In "search results", clicking "Open-in-Channel" or any searched message opens it in an EXTERNAL web browser #1007

Open
1 task done
stormy1777 opened this issue May 14, 2022 · 45 comments · Fixed by ferdium/ferdium-recipes#29
Labels
bug 🪲 Something isn't working recipe 📑 This issue is about a ferdium recipe

Comments

@stormy1777
Copy link

Avoid duplicates

  • I have searched the issues tracker for a bug report similar to mine, in vain

Ferdium Version

6.0.0-nightly.34

What Operating System are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Ferdium version

No response

Expected Behavior

After a search, the resulting found items have an issue that clicking on "view in channel" or any found message should open it within the Fredium framework/window (and not externally).

Actual Behavior

After a search, the resulting found items have an issue that clicking on "view in channel" or any found message attempts to open an EXTERNAL BROWSER at the OS level, not within the framework.

Steps to reproduce

search for any message text e.g. "test"
in the resulting "hits", click "view in channel" if opens within Ferdium, that is fine, u have not reproduced the issue, if it attempts to open an EXTERNAL view, you've managed to reproduce the issue.

Debug link

No response

Screenshots

No response

Additional information

No response

@stormy1777 stormy1777 added the bug 🪲 Something isn't working label May 14, 2022
@vraravam
Copy link
Contributor

Duplicate of #87

This is a known behavior - since many websites build up the underlying HTML differently (add to that the javascript-based click handling makes it more complex). Suffice to say that Ferdium won't be able to handle each and every combination from all websites. We are treating this as a feature enhancement for the future.

@stormy1777
Copy link
Author

I think there is a mis-communication on understanding the issue here.
The complaint is not on HTML generated in the message BODY, but rather in the messages HEADERS that is , internal slack-headers to the same message in channel, etc. let me explain again:

  1. Search for any random text, say "TEST"

  2. A list of messages will appear, from various channels/groups..

  3. On the TOP of each message is a HEADER line similar to:

    tl-workroup-testing-room TestSlack-CORE - May 14th View in channel

Each of the words in that header only (not the BODY of the message), appears as a "clickable" item.

The expected behavior when clicking "View in channel" is for that same message to open up in Slack under Ferdium's control, however, instead an EXTERNAL browser it launched and a login attempt is made to slack on the external browser..

Hopefully this is clear, not talking about user generated html or URLs or message body, clicking on the HEADER field only as explained above.

@vraravam
Copy link
Contributor

The rendering of the text as links is not something that Ferdium ever does. That seems to be something that's in the Slack web-ui (I dont use slack, and so can't check this by myself).

And for any link that appears, depending on whether the underlying html has a target="_blank" or target="top" or other choices (there is no w3 standard for this), the browsers will behave differently. Since Ferdium's webview is only a chromium browser tab, again the number of options for handling are too many for Ferdium to handle.

@vraravam
Copy link
Contributor

Reopening to continue discussion. but most likely, if this is dealing with how links are opened in Ferdium, we don't have a solution for this at all since each website behaves differently

@vraravam vraravam reopened this May 14, 2022
@stormy1777
Copy link
Author

Vijay, will try again.

  1. The links at question are 100% that of app.slack.com, i.e. not just "each website", rather, the actual SLACK generated urls :) We're talking about the HEADER urls, not some user entered URL in the BODY.
  2. These urls are not allowing to "copy link address", but with right-click it's possible to INSPECT, which shows this:

View in channel

on the right side bunch of "elements", "inherited from ..." but nothing that appears as a URL or a target=_blank or similar, not sure how the url is derived from this text, it seems some hidden url.

  1. After few attempts on Firefox and Chrome on normal browser managed to reproduce same behavior there, it opens new TAB. These browsers have just one profile so workarounds like these are not relevant: https://bugs.launchpad.net/snapd/+bug/1835024/comments/13

  2. wrote /feedback to @slack (the company) and will update here as well.

@vraravam
Copy link
Contributor

Can you please share some screenshots? Also, there was a different bug that was fixed in the latest nightly - please run the latest and then get back with further details.

@stormy1777
Copy link
Author

Thanks...
Updated to nightly.36, same issues..

No worries about screenshots. Slack support responded..

This is so-called "expected" behavior when searching between multiple "workspaces", the slack/app-generated URL opens a NEW TAB on desktop browser, and even more ridiculously it offers to open a new BROWSER on an android phone with the slack APP... yes, that's right, in Android App, clicking that link, offers to open new browser on the android(?!@@), it does not offer to open that page in current Slack APP.. go figure.. After selecting which browser, it opens, then redirects to the Slack APP... boy..

If there's a way to TRAP all https://.slack.com/client... URLs and translate them into "Ferdium" slack framework, possibly this will be a very useful (optional) feature for slack plugin, that would make Ferdium favorable to use in such cases, again, only for system/slack.com urls, anything else remains as today.

@vraravam
Copy link
Contributor

@stormy1777 - since I don't use Slack, could you please try with something similar to: https://github.com/vraravam/ferdium-recipes/blob/main/recipes/gmail/webview.js#L9-L15 (change the values for slack, and of course, it needs to be done within the slack configuration.

Please make the changes in your <FerdiumProfileFolder>/recipes/slack folder, test them out and create a PR for the same.

If you want, I can come and help on zoom to walk you through the changes and help take this further

@vraravam
Copy link
Contributor

@stormy1777 - I have just merged an implementation in this PR: ferdium/ferdium-recipes#29 - it should be available for you in the next nightly. Thanks

@stormy1777
Copy link
Author

Thanks for the effort, took the lines at tail of this
https://github.com/ferdium/ferdium-recipes/pull/29/files#diff-652a57350b691a5ff250e4f3d675518d8736acef3ccba529a656d9f4dd59a470

added them to Webview.js in Ferdium/recpies/slack folder, and did not see any difference in behavior, urls still jump externally to browser, similar links:

https://app.slack.com/client/T0168MWKGG4/....

Thought it might be "http" vs "https", changed, restart Ferdium, but again, same behavior.. so, not sure what needs to take place to include such urls within the app, and not jump ship (to external browser) maybe need to specifically say contains: 'slack.com/client'.. Can test any other idea...

@stormy1777
Copy link
Author

Now noticed that "sign into another workspace" from the "add workspaces" menu option also jumps to external browser, url as:

https://app.slack.com/workspace-signin/.....

Similar tools-> Workflow builder jumps to external with this url: https://app.slack.com/workflow-builder/.....

not sure how this is supposed to work if these go to external browser :) :) the whole point of the dedicated app is to retain all within it, eliminating the need for external browser. (Not talking about user data that may contain random URLs, which may necessitate an external browser, the app itself i would think should be self-contained within Ferdium).

@vraravam
Copy link
Contributor

the app itself i would think should be self-contained within Ferdium

That's the intent, but if the website authors do such special handling to explicitly open external browsers, there's only so much that Ferdium devs can do. I was able to test my same exact changes (with and without) on Ferdium's own discord channel - and they worked seamlessly as expected. Without those changes, link-clicks opened my external default browser, while with them, the link-clicks opened in Ferdium's same service (even for URLs of other websites eg github). Not sure how much more I can help here.

@stormy1777
Copy link
Author

Updated to nightly.37, see the changes in slack/webview.js; same as what I've typed the other day (with "http" not "https" as i've also attempted), still, when clicking a link in HEADER of message that belongs to another workspace it attempts to open up in a new BROWSER :) :)

URL in browser appears as: https://app.slack.com/client/T6Z090R.....

I may be wrong, but I think we're (still) talking about different things for some reason...

The links are NOT text that is written by users in a message., it is generated by the Slack "app" automatically. no way to control content/layout of that URL, it's just a clickable item, and it only happens after SEARCHING, and only when clicking on a message from ANOTHER workspace than the current one :)

If all these conditions exist, then it "jumps into an external browser".. the question is can these "clicks" be "trapped" by the engine/logic..

you say "website authors do ... special handling".. From what I see it's just a URL, no where do they launch Firefox or Chrome specifically via javascript or otherwise, or do you think that is what's happening here? Sorry, I just don't know enough... but can't see how they would know the path to launch an external program from.

@vraravam
Copy link
Contributor

Unfortunately, as I have stated before, I dont use slack, and I can't visualize/reproduce/experiment with the scenario that you describe. I thought a screenshot wold be helpful - but, that's also not there. I will let someone else try to help out on this one.

@vraravam vraravam reopened this May 16, 2022
@stormy1777
Copy link
Author

Here is how general purpose Slack Search result look like:

image

the "header" of each message has a line as follows:

#channel-name-slk Workspace-name – May 16th View in channel

So, 4 "clickable" fields [ sometimes only 2 are visible, as in photo above]

  • channel NAME is which channel msg was found
  • If hit is found in DIFFERENT workspace then Workspace name is printed here before date, otherwise it is not printed
  • Date
  • "view in channel" - this is seen only when coming close with mouse, and this is the link in question..
    (honestly i think they all go to same spot/place/url)

What I've observed is that when clicking on hits WITH a Workspace NAME printed (meaning the hit is from a DIFFERENT workspace than our current one), then (on Ferdium) an external browser is launched by the act of clicking the link.
On a PC Browser, it launches a new TAB within the same browser, with that hit highlighted..

If further questions, feel free to ping in private if that is possible/desirable.
Stormy.

@vraravam
Copy link
Contributor

I have reverted the changes to the slack recipe since that didn't seem to fix your problem. In fact, it brought up more issues #158 as an example. Please try with the next nightly, and we can try to find a proper solution for this.

@MagicLegend
Copy link

Honestly the way you describe it @stormy1777 (opening browser with the different workspace) sounds like how I'd want it to behave. How else am I supposed to get back to the original workspace I was in?

But I don't really use cross-workspace Slack :) So it's not really an issue for me.

@stormy1777
Copy link
Author

@MagicLegend how does one go "back" in any browser context environment? Maybe BACK button ? :) :)
Slack has: ALT-LEFTARROW as "Back", which one can map to mouse or whatever..
Not expecting a solution overnight.. just reporting what "user experience" in such a case :) :)

Ran nightly.38, and same as before, at least we didn't break anything else :) :) I use slack, but do not know enough how to or what to translate these urls into for it to remain in same window/tab (Ferdium)...

@vraravam
Copy link
Contributor

how does one go "back" in any browser context environment?

The answer is in your comment: Since Ferdium's services are just chromium tabs, a simple keyboard shortcut to go back is Cmd+leftArrow on macos. I suspect the equivalent to work in other OSes. Or else, you can also enable the navigation bar in the Settings > Appearance, and then use the back button there.

@stormy1777
Copy link
Author

Thanks @vraravam was just joking a bit :) Thanks for full explanation, i think nav bar is in Settings -> General (not Appearance)

@MagicLegend
Copy link

@MagicLegend how does one go "back" in any browser context environment? Maybe BACK button ? :) :)

Have you tried it in Slack? It will work, but it'll go through all your previous actions first (i.e. channel switches). Not very ideal if you ask me.

But why wouldn't the Open link in Ferdium context menu option suffice for your usecase?

@stormy1777
Copy link
Author

Friends, sorry, I was just responding (sarcastically) to the question @MagicLegend posed as "How else am I supposed to get back to the original workspace I was in?" by saying/asking maybe BACK button? Yeah, use the back button all the time in Slack, works fine.
The issue at hand is that URLs that "jump workspace" are also jumping to an external program at the OS level, and attempt to open the default browser...

You wrote "have you tried it in slack?" Tried what? Lets stay focused, this thread does not talk about going BACK to previous pages, it's an attempt to avoid opening an EXTERNAL browser :) :)

I'm not sure what "Open link in Ferdium context menu option" entails/will bring/change, but will be:
a) Glad to test any .nightly build with proposed fix
b) As much as possibly, manually apply changes thus avoiding making unconfirmed changes into .nightly..

@MagicLegend
Copy link

@stormy1777 Well, the context option already exists:
image

@stormy1777
Copy link
Author

@MagicLegend Oh, wow, was NOT aware of that... however, from looking/trying a bit, seems we're back to square one again, as the URLs in questions are NOT user/generated, they are NOT URLs someone is typing, rather these are in the HEADER of each message from the search result, i.e. auto-generated by Slack program/logic.. the long-rightclick does not offer open in Ferdium...

Now, another interesting "plot twist".. went to Android phone which have not used a while, and there, these links JUMP OUTSIDE of Slack app, and make you even choose a browser of choice, it launches the browser then does a redirect and Launches Slack again!!! into, the new workspace :) :) so possibly the app does not have a means/ways to switch workspaces only via a Browser URL :) not sure, but that JUMP ship is there on Android/slack/app....

@vraravam
Copy link
Contributor

Oh, wow, was NOT aware of that... however, from looking/trying a bit, seems we're back to square one again, as the URLs in questions are NOT user/generated, they are NOT URLs someone is typing, rather these are in the HEADER of each message from the search result, i.e. auto-generated by Slack program/logic.. the long-rightclick does not offer open in Ferdium...

I dont understand what you mean by "long click". The context menu opens up on right-click.

@vraravam
Copy link
Contributor

Now, another interesting "plot twist".. went to Android phone which have not used a while, and there, these links JUMP OUTSIDE of Slack app, and make you even choose a browser of choice, it launches the browser then does a redirect and Launches Slack again!!! into, the new workspace :) :) so possibly the app does not have a means/ways to switch workspaces only via a Browser URL :) not sure, but that JUMP ship is there on Android/slack/app....

Are you performing this action within Ferdium on an android phone? We are not even targetting a mobile form-factor usage for Ferdium!

@stormy1777
Copy link
Author

I dont understand what you mean by "long click". The context menu opens up on right-click.

sorry, it appears that even a short-right click opens, either way, the links in questions (header) open up a different context menu thank for links embedded in messages...

@vraravam
Copy link
Contributor

vraravam commented May 17, 2022

sorry, it appears that even a short-right click opens, either way, the links in questions (header) open up a different context menu thank for links embedded in messages...

did you mean right-click and selecting the "Open link in Ferdium" option?

@stormy1777
Copy link
Author

Now, another interesting "plot twist".. went to Android phone which have not used a while, and there, these links JUMP OUTSIDE of Slack app, and make you even choose a browser of choice, it launches the browser then does a redirect and Launches Slack again!!! into, the new workspace :) :) so possibly the app does not have a means/ways to switch workspaces only via a Browser URL :) not sure, but that JUMP ship is there on Android/slack/app....

Are you performing this action within Ferdium on an android phone? We are not even targetting a mobile form-factor usage for Ferdium!

No, all the Ferdium work is on Windows 10, the android/slack was given as a comparison, how that situation is handled on an Android platform completely 100% by Slack/native app there, it seems they JUMP SHIP to a browser, then redirect into Slack app, into the new workspace :) :) funny.. all that just to switch workspace.

I do not know if Ferdium can switch workspaces using a URL... maybe that's a limitation of slack, not sure... just gave that as a baseline to compare with.

@vraravam
Copy link
Contributor

I do not know if Ferdium can switch workspaces using a URL... maybe that's a limitation of slack, not sure... just gave that as a baseline to compare with.

No - that's not possible in Ferdium (if you are referring to "workspace" feature of Ferdium. Are you?

@stormy1777
Copy link
Author

did you mean right-click and selecting the "Open link in Ferdium" option?

Please carefully review this post: #1007
where the HEADER of a Slack message is explained.. those 3 or 4 links open up a DIFFERENT context menu in Ferdium which does not have the "open in Ferdium" option :) That option only appears in URLs that are part of a user generated text, inside a MESSAGE, not the HEADER of a message.

@stormy1777
Copy link
Author

I do not know if Ferdium can switch workspaces using a URL... maybe that's a limitation of slack, not sure... just gave that as a baseline to compare with.

No - that's not possible in Ferdium (if you are referring to "workspace" feature of Ferdium. Are you?

no, Slack also has a "workspace", please review this post:
#1007
it explains the header format, one of the fields is Slack Workspace, which is different than Ferdium.. it's different channels in slack belonging to diff workspaces, however, often users get access to multiple workspaces, and search can easily span them...

@vraravam
Copy link
Contributor

can you please annotate that figure? For a person who doesn't use slack, i can't fathom which "those 3 or 4 links" you are referring to!

@vraravam
Copy link
Contributor

it explains the header format, one of the fields is Slack Workspace, which is different than Ferdium.. it's different channels in slack belonging to diff workspaces, however, often users get access to multiple workspaces, and search can easily span them...

ok - if you are referring to "slack workspaces", then yes, any change in the url (which can include a change in the slack workspace) can be handled by Ferdium.

@stormy1777
Copy link
Author

Funny... it's written in that OP, here is an improved version :)

#channel-name-slk Workspace-name – May 16th View in channel
<FIELD 1> < FIELD 2> < FIELD 3> < FIELD 4>

please read the text description in:
#1007
for each field (field 2 is optional, and field 4 is invisible until mouse hovers over it)

@vraravam
Copy link
Contributor

Sorry @stormy1777 - I'm unable to help any further. as I have stated earlier, I dont use slack at all. I am not able to correlate where you say "#channel-name-slk" with the appropriate part of the image that you have attached. I have requested you to annotate the image so that this correlation is visually indicated. If that's not possible, then I wont be able to help any further

@vraravam
Copy link
Contributor

If you come on discord, we can do screen sharing and you can explain the problem, and maybe I can help with possible solution or a workaround. Conversing in this manner of a synchronous dialog in GH doesnt help to move forward

@MagicLegend
Copy link

@stormy1777 Can you please use actual screenshots? I do use Slack every day, and I don't get what you're referring to either 😄

@stormy1777
Copy link
Author

@MagicLegend Please see title of ticket " IN SEARCH RESULTS" one must SEARCH in order to get results (with headers)... these headers have 3 or 4 links based on if the hit is from "same" or different slack-workspace...

Here is that image/with the header region highlighted:

168631756-4f8c6c51-eda7-412e-978f-057a3757265f

these headers only appear to show 2 links, since they are all from SAME slack workspace..

The "view in channel" (FIELD 4 in header) only becomes visible when mouse is moved closer to one of the search hits/messages.

PS: Tried to connect on discord, got lost from too much noise/links, can't figure that platform yet..

@MagicLegend
Copy link

But when I search in Slack in Ferdi it looks like this. Is the highlighted View in channel hover (marked in green here) the button you're referring to?

image

Because you are correct that that link does not have the Open Link in Ferdium action. Which I'm assuming is because it's not an actual <a> you're clicking, it's done with JS and CSS.

@stormy1777
Copy link
Author

yes, that is the "view in channel", if it so happens that channel is in SAME slack-workspace, then it will open in Ferdium, otherwise, it will "jump ship" and launch an external browser..

btw, from what i see, clicking any of the 3-4 fields in the header does the same thing, either opens the message in same workspace, OR, launches a browser, if hit is from diff workspace :) :)

I suspect if that "jump ship" could be intercepted and url "modified" to "feed" back into Slack, it would just show the message regardless of the workspace....

@cino
Copy link
Contributor

cino commented Nov 10, 2022

@stormy1777 Is this issue resolved as expected? For myself I can't seem to reproduce the original issue and all clickable fields will open inside the ferdium instance.

@stormy1777
Copy link
Author

stormy1777 commented Nov 10, 2022 via email

@MagicLegend
Copy link

@cino Keep in mind that this issue appears to be limited to links that go to a different Slack workspace. I personally don't use this feature, and all other links work as intended.

@stormy1777 Could you please confirm that the link goes to a workspace outside of the current one? Is it correct that you are the external one in those channels? Personally I'm always the internal person, so I don't have easy access to that scenario for testing. Internally (so in a channel in our workspace, with third party people) it does work correctly, so I'm thinking this might only be if you're the external person?

@cino
Copy link
Contributor

cino commented Nov 11, 2022

@MagicLegend Thanks for making that clear, in that case I'm moving this issue to the ferdium-recipes repository as this is not related to the app itself and more like a feature in slack. (housekeeping 🧹 )

@cino cino transferred this issue from ferdium/ferdium-app Nov 11, 2022
@nathanaelhoun nathanaelhoun added the recipe 📑 This issue is about a ferdium recipe label Feb 15, 2023
@nathanaelhoun nathanaelhoun transferred this issue from ferdium/ferdium-recipes Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working recipe 📑 This issue is about a ferdium recipe
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

5 participants