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

inappbrowser with usewkwebview not open the links with <a href=.. target=_blank> #417

Closed
mosabab opened this issue Feb 9, 2019 · 9 comments

Comments

@mosabab
Copy link
Contributor

mosabab commented Feb 9, 2019

My app using inappbrowser to open external link and work fine, and the page with that link has more links inside,
After apple change the webview, I try to use usewkwebview=yes in options, but there is a bug in the inappbrowser for links that opened as new tab:
e.g.: <a href= target="_blank">

Inappbrowser will not open any links with target=_blank.

So, if the user click on that link, it will not show anything, just like there is no any links.

This happened just for links with <a href= target="_blank">

So, any website has links with target blank, will not open in inappbrowser if the option usewkwebview is set to yes.
<a href= target="_blank"> // in html for links
(this mean for browser : to open the link in new tab, but for inappbroswer, it should open in the same window.).

I try to open many websites that have some links to open in new tab (with target=_blank) via inappbrowser, but nothing happened.

Apple change the webview and inappbrowser without usewkwebview=yes will not work for ios devices, so any websites has <a href with target=_blank will not open.

Inappbrowser before i set wkwebview to yes was work fine, but after apple change the webview, some websites not work, so i set to use wkwebview to yes and work fine except any links with target = _blank.

Please solve this issue as soon as possible.

Please note that i am using the master version of cordova inappbrowser plugin to test my app.

@dpa99c
@timbru31
@janpio

@dpa99c
Copy link
Contributor

dpa99c commented Feb 10, 2019

Please confirm if you are using target=blank or target=_blank since the latter is valid and the former is not - see the MDN docs

@mosabab
Copy link
Contributor Author

mosabab commented Feb 10, 2019

Hello @dpa99c
I am using target=_blank,

I try to open many websites that using some links to open in new tab, but inappbrowser with wkwebview=yes not open those links.

Inappbrowser before i set wkwebview to yes was work fine, but after apple change the webview, some websites not work, so i set to use wkwebview to yes and work fine except any links with target = _blank.

Regards

@mosabab mosabab changed the title inappbrowser with usewkwebview not open the links with <a href=.. target=blank> inappbrowser with usewkwebview not open the links with <a href=.. target=_blank> Feb 10, 2019
dpa99c pushed a commit to dpa99c/cordova-plugin-themeablebrowser that referenced this issue Feb 10, 2019
…=on links in WKWebView implementation on iOS
@dpa99c
Copy link
Contributor

dpa99c commented Feb 10, 2019

I could reproduce the issue on iOS/WKWebView and have implemented a solution based on https://stackoverflow.com/a/25853806/777265 as PR #418

@mosabab
Copy link
Contributor Author

mosabab commented Feb 10, 2019

hello @dpa99c ,

Thank you for response,

Can you please tell me when this will affect the master version ? or how can i put the plugin with this implemented solution ?

janpio pushed a commit that referenced this issue Feb 10, 2019
@mosabab
Copy link
Contributor Author

mosabab commented Feb 11, 2019

@dpa99c @janpio Thanks for solve the issue, but there still another issue with inappbrowser when wkwebview=yes.!
Issue details:
if you try to open external websites like: trivago.com , expedia.com , hotelscombined.com and try to search for hotels and try to make reservation or booking, blank screen appear and some websites display warning message.

Can you please try to open https://www.trivago.com/ in inappbrowser ? you will see what i mean, try to open any website like agoda.com or any booking websites, and try to make a booking, you can't make bookings, i don't know why this happened , I know that whitelist not affect inappbrowser, I think this behavior like you can't access websites like for bookings.

My app using affiliate program to compare prices from booking websites, so my app compare prices form my website and after that , user will redirect to booking websites,
after apple change the webview, I set in approwser to use wkwebview, but after this change, I can't make booking in hotels and travel sites. my app try to compare prices via inappbrowser.

Can you please check the problem ?

Try to open links in inappbrowser such as:
https://www.agoda.com/
https://www.trivago.com/
https://www.expedia.com/
And try to make click on reserve room or book room button and you will see what i mean !

to try my app please see this example:

inAppBrowserRef = cordova.InAppBrowser.open('https://hotels.jetradar.com/?locale=en', '_blank', 'usewkwebview=yes');

Thanks

@janpio
Copy link
Member

janpio commented Feb 11, 2019

Create a new issue for this new problem please.

@mosabab
Copy link
Contributor Author

mosabab commented Feb 11, 2019

@janpio
#422

@mosabab
Copy link
Contributor Author

mosabab commented Feb 11, 2019

Create a new issue for this new problem please.

Hello, @janpio i create an issue about this, just for confirmation:
This new issue happened after you update the code.

I try to use an old plugin : https://github.com/dpa99c/cordova-plugin-inappbrowser-wkwebview
Work fine, but not work, so when you update the new code you make a new issue , can you please test the issue , just try to open any website inside inappbrowser, and you will see the issue

@mosabab
Copy link
Contributor Author

mosabab commented Feb 11, 2019

@janpio @dpa99c please check the previous updated code, now: you can't open any websites, HEADER BROWSER HAVE AN ERROR

When you edit code to resolve this issue, there a new issue generated.

Please try to use inappbrowser to open any websites, for example: please use: https://www.trivago.com/ to see what appear.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants