Android-PWA-Wrapper icon indicating copy to clipboard operation
Android-PWA-Wrapper copied to clipboard

External links constantly opening

Open mrjackwills opened this issue 6 years ago • 9 comments

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

mrjackwills avatar Oct 07 '19 14:10 mrjackwills

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..

sancamac avatar Dec 09 '19 00:12 sancamac

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

jampy avatar Dec 19 '19 12:12 jampy

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

peetyo avatar Mar 24 '20 13:03 peetyo

+1

richardrails avatar Jun 17 '20 15:06 richardrails

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

camoralb avatar Jul 08 '20 04:07 camoralb

will somebody merge it? @xtools-at

richardrails avatar Jul 14 '20 06:07 richardrails

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

xtools-at avatar Jul 14 '20 09:07 xtools-at

please could you merge it?

richardrails avatar Aug 06 '20 06:08 richardrails

not yet merged?

rebootcode avatar Oct 18 '20 18:10 rebootcode