Opening links within apps

Some apps have an in-app browser (Discord). Is there anyway to open a link WITHIN the app you clicked it in, instead of opening your browser and redirecting you there?

The app must support this. It must have a browser implemented, if it is to come from the Android system, then it must be Webview.
You can’t configure anything in Android itself without the app having programmed it in.

Discord doesn’t have an in-app browser technically. Like many other Apps it can use what Android can offer to display web content in-app, be it Chrome on a stock Android including Google Apps and services or Android Webview on a Custom ROM.

In Discord, enable Settings - Behaviour - Use Chrome Custom Tabs.
To get to the Settings, tap the menu, then your avatar picture.

/e/ doesn’t have Chrome by default, but this works nonetheless.
I guess the Discord developers didn’t bother to query the system for which browser component is really there and just wrote “Chrome” assuming a stock Android. Which is fair, since Discord is Google-dependent and only works on /e/ thanks to microG.

Can also be done on Mozilla-based browsers (Fennec, Firefox) which - I believe - use GeckoView rather than Android Webview

I did what you said, still opens a link inside a new app instead of discord… I tried this on the stock Rom before I installed e so not sure why it doesn’t work now

Works as intended for me on 0.18-q-20210827132307-dev-FP3 (Settings- About phone - Android version - /e/ version) with Discord 92.9 - Stable.

If the setting is enabled, links get opened within Discord. If the setting is disabled, links get opened in my default browser (Fennec F-Droid).