Github user JoMas971 commented on the pull request:
https://github.com/apache/cordova-plugin-inappbrowser/pull/122#issuecomment-194295105
Hi @Sinistralis, in fact i've done a fork and merge your PR to test it out.
It seems that you miss only one thing with your PR : the inappbrowser.js is
loaded for iOS and other platforms too. But, since you haven't created the
getCookies/setCookies methods for them, the build fail for these platforms and
that's not good at all ! (1)
To fix this, i've used the cordova device plugin to execute the `exec(...)`
function only on android, but that mean you'll need to have the
cordova-device-plugin installed. I don't think it's the best way to do that,
and it can definitely be improved but it's still a working solution. (you can
see my fork here :
https://github.com/ilanddev/cordova-plugin-inappbrowser/tree/mergin_1.3.1).
Otherwise, i'm using crosswalk, and this PR seems to fix my cookies sharing
issues. I just have to call manually the getCookies() function before the
window.close() action when i log in to my app using Keycloak, to share the
cookies inside my popup with my crosswalk webview allowing me to use Keycloak
iFrames inside my app. Which is really good :-).
This is the only working way i've found to share cookies between 2
different webviews. The InAppBrowser plugin use the native UIWebView and, it
seems, they will not change this behaviour, so we need something to share
cookies between 2 different WebViews system (Native WebView and
WateverOtherWebView).
The same thing happens if you want to use the iOS WKWebView instead of the
UIWebView. Since it is a different WebView system, you can't share cookies
between them (it is not automatic). It could be really cool if we can have
these magic methods for iOS toà (and that will fix my (1) point !). That way
we can use the new and powerful WKWebView for our iOS application too. Have you
consider to do some Objective C code ? :-D
Thank you for your work by the way !
Hope this will be merge someday, it is definitely a solution for those who
use different WebView system :-).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]