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

External links constantly opening #15

Open
mrjackwills opened this issue Oct 7, 2019 · 9 comments
Open

External links constantly opening #15

mrjackwills opened this issue Oct 7, 2019 · 9 comments

Comments

@mrjackwills
Copy link

mrjackwills commented Oct 7, 2019

I am having one slight issue at the moment.

When external links are pressed in the app/twa, they open an instance of chrome/firefox/other_browsers, and constantly load up new tabs of the external site address. I am greeted with 200+ tabs for the same address each time.

I have little to no android development experience, the only thing I can seem to debug is that the lines;

view.stopLoading();
view.reload();

in Android-PWA-Wrapper/app/src/main/java/at/xtools/pwawrapper/webview/WebViewHelper.java seem to be the issue.

Removing the view.reload means the external site is only opened in one tab in the default browser, however pressing back button to go back into the app means that the pwa is now frozen. Unfortunately I do not have enough knowledge on what the best solution is

@sancamac
Copy link

sancamac commented Dec 9, 2019

Hi!
The workaround i found to solve this is:
IIn Android-PWA-Wrapper/app/src/main/java/at/xtools/pwawrapper/webview/WebViewHelper.java

REMOVE the lines
view.stopLoading(); view.reload();

INSTEAD ADD:
view.loadUrl(Constants.WEBAPP_URL);
after the try{}catch{} of the intent for the external link

The thing is that this is not a complete solution as it navigates to the specified url in every external link.

What is happening in this issue is that the app is entering in an infinite loop with the reload inside the @OverRide of onPageStarted().

hope it helps..

@jampy
Copy link

jampy commented Dec 19, 2019

Thanks, but is there a better solution to this problem?

Problems:

  • this reloads the PWA app
  • my primary browser is Firefox and while this solution sends a new tab to Firefox in background, it does not switch to the browser view

@peetyo
Copy link

peetyo commented Mar 24, 2020

Hey, I'm trying to solve the same issue. Did you guys find a better solution eventually?

@richardrails
Copy link

+1

camoralb added a commit to camoralb/Android-PWA-Wrapper that referenced this issue Jul 8, 2020
This may solve the "External links constantly opening xtools-at#15" issue
@camoralb
Copy link

camoralb commented Jul 8, 2020

I have created a pull request with a fix for this. I hope these changes can solve the issue.

@richardrails
Copy link

will somebody merge it? @xtools-at

@xtools-at
Copy link
Owner

Thx @camoralb, will test/merge it when I'm back from vacation

@richardrails
Copy link

please could you merge it?

@rebootcode
Copy link

not yet merged?

Repository owner deleted a comment Jan 23, 2024
Repository owner deleted a comment from Pappyskull1 Feb 23, 2024
Repository owner deleted a comment from jacky-xbb Mar 4, 2024
Repository owner deleted a comment from jabreuint Mar 19, 2024
@github-staff github-staff deleted a comment from cmurav May 12, 2024
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

10 participants