-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Fix broken external links #1395
base: master
Are you sure you want to change the base?
Fix broken external links #1395
Conversation
Hi, thanks for the PR. Do you have a specific example where this happens? For me, external links open in the browser just fine. So this seems to be an issue in the web client for some links instead. |
Fascinating. What type of library, item and which metadata field was it? |
I always used the Overview field and the behavior is the same for a movie, show, playlist, or collection |
I see, I can reproduce it now, thanks for providing all these details. I'm worried that the current matchers aren't enough and would cause pages to open externally which shouldn't. Authentication components/plugins, for example. I feel like web should preferably handle this, but I'm not sure how. |
that's a good point, i'll keep looking into this to see how android handles these calls and try to make it more robust. |
Thanks! Appreciate your work, hopefully you can find a good solution to this issue. |
ok, so the docs offer some notes on when this method actually gets called, and it's fairly limited. It's called for navigations initiated by the web page, the user, or an HTTP redirect. Notably, it's not called for any navigations initiated by the app, but that doesn't mean it's impossible to trigger it from the app's code. The WebViewFragment triggers it when it loads <serverUrl>/web on initialization (but not when it loads a javascript url from the lifecycle scope). This is allowed to load internally because it's on the same host (including port) as the server, and it's the only instance I found of the app itself triggering this method in my limited testing so far. One way I could lock it down a bit further is to require the request be associated with a gesture (such as a click, but we only get a boolean, not the type) in order to load it externally. I think I'll add that now so any reviewers can see it. With all that said, I'm an android and web app novice, so I could easily be missing something with how android works here. |
Changes
Links in metadata would open in the app and lock it up. I override the function shouldOverrideUrlLoading to launch external links with the system. External links are defined as those that aren't intercepted by shouldInterceptRequest and don't contain the server hostname.
Issues
Fixes #984