apache / cordova-plugin-inappbrowser

Apache Cordova InAppBrowser Plugin
https://cordova.apache.org/
Apache License 2.0
1.12k stars 2.15k forks source link

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

Closed mosabab closed 5 years ago

mosabab commented 5 years ago

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

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

So, any website has links with target blank, will not open in inappbrowser if the option usewkwebview is set to yes. // 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 commented 5 years ago

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 commented 5 years ago

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

dpa99c commented 5 years ago

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 commented 5 years ago

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 ?

mosabab commented 5 years ago

@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 commented 5 years ago

Create a new issue for this new problem please.

mosabab commented 5 years ago

@janpio https://github.com/apache/cordova-plugin-inappbrowser/issues/422

mosabab commented 5 years ago

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 commented 5 years ago

@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