Crosswalk and InAppBrowser


#1

Hi,
is there an easy solution to share cookies between crosswalk webview and inappbrowser?


#2

I need a solution for this bug too… my app has poor performance in Android < 4.4, but work fine with crosswalk

BUT

I can’t use InAppBrowser for login in the server anymore, because the InAppBrowser webview not share cookies with the crosswalk app webview.


#3

I am writing a new inAppBrowser for android, using crosswalk as webview. I will share the plugin as soon as its ready.


#4

I am writing a new inAppBrowser for android, using crosswalk as webview. I will share the plugin as soon as its ready.

Thank you!


#5

Do you know https://github.com/SidneyS/cordova-plugin-inappbrowser-crosswalk/blob/master/doc/index.md ?

It’s old and not work but maybe can help.


#6

This is a “fake”. Its the same as the standard inAppbrowser.

I already finished the plugin, i will upload it soon.


#7

So here it is:

Have fun!


#8

thank you, brother!

This plugin will work in iPhone?


#9

Can I use EventListeners or methods like ref.close() and ref.show()?

example

var ref = window.inAppBrowserXwalk.open(url, "_blank");

ref.addEventListener('loadstop', function(e) {
              console.log(e.url);
              urlparts = e.url.split(".");
              if (urlparts[1] == "facebook") {
                ref.show();
              }
...

What are the values of options available?

I can trace the opened url in inappbrowserxwalk?


#10

No, at the moment you only have the features presented in the example.


#11

Thank you. I can track the opened url changes?


#12

No, at the moment you only have the features presented in the example.


#13

You did a great job, thanks again.

Maybe you can help me to adapt my code to log into the server before the crosswalk to one that works in this plugin.

Below is a snippet of the code.

var ref = cordova.InAppBrowser.open(url, "_blank", 'location=no, zoom=no');

      ref.addEventListener('loadstop', function(e) {
          console.log(e.url);
          urlparts = e.url.split(".");
          if (urlparts[1] == "facebook") {
            ref.show();
          }
        console.info("User.checkingserver", User.checkingserver);
          if (e.url == SERVER.url + '/node/8') {
              ref.close();
              $http.get(SERVER.url + '/restws/session/token')
                  .success(function(data, status, headers, config) {
                      User.data.token = data;
                      User.data.logged = true;

                      var req = {
                          method: 'GET',
                          url: SERVER.url + '/restws/custom/whoami',
                          headers: {
                              'Content-Type': 'application/json',
                              'X-CSRF-Token': User.data.token
                          }
                      }

                      $http(req).success(function(data, status, headers, config) {
                              User.data.serverdata = data;
                              User.logoff = false;

                              deferred.resolve(User.data);
                          })
                          .error(function(data, status, header, config) {
                              deferred.reject('2.2. Não foi possível obter dados do usuário logado. Erro: ' + status);
                      });
                  })
                  .error(function(data, status, headers, config) {

                      deferred.reject('2.1. Não foi possível obter o token de autenticação. Erro: ' + status);
                      User.socialnetwork = null;
                  });
          }
          if( window.cordova && cordova.platformId === "android" ) {
          }
      });
      ref.addEventListener('exit', function(e) {
          User.checkingserver = false;
      });

#14

Basically you just have to adapt it to something like this:

var ref;
if (cordova.platformId === "android" ) {
   ref = window.inAppBrowserXwalk.open(url);
}
else {
   ref = cordova.InAppBrowser.open(url, "_blank", 'location=no, zoom=no');
}
...

But to make this code work i have to update the plugin. At the moment, it does not return a reference to the browser object. This is required to add event listerners.


#15

Hello Claas

I have a similar problem and would like to use the crosswalk webview with a window reference (for support of the “loadstart” and “exit” events).

Do you have plans to extend your plugin with window references in near future?

If not, maybe I will try to fork your project on github and try do it be myself. From your experiences so far, is the api and the bevaviour of the XWalkView similar to the default WebView? So that the plugin could be realised similar to the inappbrowser plugin (at least as a starting point)?


#16

Check out my new post: InAppBrowser using Crosswalk Webview


#17

I am having the same problem in IOS 10. Can you help