Cordova Slack Digest

Tue, 07 Sep 2021 08:21:03 GMT

User count: 4610

Join the conversation at slack.cordova.io

Channel #random (1 messages)


Mon, 06 Sep 2021 17:07:45 GMT

@norman137 says

Monday cat

Channel #general (32 messages)


Mon, 06 Sep 2021 10:19:08 GMT

@andrew867 says

Is there a means to capture before unload? In particular on Windows - need to ask if users are sure they want to loose the changes theyโ€™ve made w/o saving

Mon, 06 Sep 2021 13:06:25 GMT

@infacto says

@andrew867 https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

Mon, 06 Sep 2021 13:07:08 GMT

@andrew867 says

@infacto - thanks Iโ€™ve used that in many browser based app, works fine. Canโ€™t get it to trigger in the installed App

Mon, 06 Sep 2021 13:09:15 GMT

@infacto says

Hi there, Is there a feature in Cordova to get WebView infos like name and version? Or do I have to implement it myself with e.g. navigator.userAgent? On Android the user should have the latest Chrome version installed.

Mon, 06 Sep 2021 15:42:24 GMT

@norman137 says

navigator.userAgent should tell you the running webview unless you override the user agent with the preferences.

Mon, 06 Sep 2021 16:29:14 GMT

@infacto says

I also found this: https://github.com/NoNameProvided/cordova-plugin-webview-checker But not sure if I use this plugin or write my own js script with useragent. ๐Ÿค”

Mon, 06 Sep 2021 16:31:33 GMT

@norman137 says

user agent will provide the same data -- or just use feature detection if you're unsure if the webview supports said feature.

Mon, 06 Sep 2021 16:36:32 GMT

@infacto says

Is there a way to embed the WebView in a Cordova (Ionic) app? It's a bit weird to ask the user to update the Chrome browser. ^^ The problem is that some users disabled the Chrome browser or never update. In both cases a very old version of Chrome is used and produces some support requests of not working apps. ๐Ÿ˜ž

Mon, 06 Sep 2021 16:38:19 GMT

@infacto says

I have no experience with Crosswalk (https://github.com/crosswalk-project/crosswalk) but this looks like what I want. But it's deprecated.

Mon, 06 Sep 2021 16:38:24 GMT

@norman137 says

It‘s possible, but not recommended and unless if you’re as big as Intel you probably don't have the manpower to do so.

Intel used to have a project called Crosswalk but they stopped maintaining the project in 2017

Mon, 06 Sep 2021 16:38:48 GMT

@norman137 says

The last crosswalk version is based on Chrome 53

Mon, 06 Sep 2021 16:39:33 GMT

@norman137 says

Google does not build chrome to be used as an embeddable library so it takes a significant amount of work and refactoring to make it possible.

Mon, 06 Sep 2021 16:40:41 GMT

@infacto says

So I have to build a script (es5) for index.html to detect the version and inform the user to update. Because this script has to be run before the Angular app and other stuff in old js. Or what would you do?

Mon, 06 Sep 2021 16:41:29 GMT

@norman137 says

The offiicial reason why Intel stopped maintaining crosswalk is because modern day android phones have an independently updatable webview starting in android 5.0 which is based off of Chrome instead of the crappy android browser you saw pre android 4.4.

I think one of the biggest nails in the coffin is also Google stopped using something called GYP and started transitioning to a different build system which breaks A LOT of what intel built to support crosswalk.

Mon, 06 Sep 2021 16:42:49 GMT

@norman137 says

Well it depends on why you want the user to update... not all devices can update to the latest webview. ANdroid 5.1 I think is limited to like webview v70ish

Mon, 06 Sep 2021 16:43:25 GMT

@infacto says

In our case, we have customers which only uses our app. They don‘t use or care about other apps like Chrome. But it’s important for our app to run. argh... ^^ Hard to tell the user why.

Mon, 06 Sep 2021 16:43:40 GMT

@norman137 says

In my personal experience if I was using a relatively new feature only introduced in the more recent chrome versions, then I'd have a polyfill fallback

Mon, 06 Sep 2021 16:47:14 GMT

@infacto says

Yes this and polyfills is a good common way to support such cases. But another reason to update browsers is performance and other behaviors. ... Anyway... thanks for advice. ๐Ÿ™‚

Mon, 06 Sep 2021 16:54:01 GMT

@norman137 says

I know your pain though, I‘m the kind of person who likes to strictly pin their dependencies as a way of saying “I know for certain this version works” and I don’t like stuff blindly updating perhaps in an incompatible way...

Crosswalk was the answer for that. Couple of my apps still use it jus tbecause I haven‘t updated them yet. But crosswalk doesn’t work properly building the bundles either, so the next time I do update those apps I have no choice but to remove crosswalk.

Mon, 06 Sep 2021 17:01:55 GMT

@infacto says

I had already experienced things that could not be fixed with polyfills etc. For example, changes in the Blink Engine in Chrome. I don't remember exactly, but it was something about SVG I worked a day before. And the next morning, the Chrome browser automatically updated and rendered it with glitches. So, having the latest browser is also not always the best. ๐Ÿ˜„ But yes, in the best case everyone uses the app in the browser version I tested. ... Embedded webview has pros and cons like everything in this world. Pro: The same behavior and safety for all users. Con: Harder to update / maintain.

Mon, 06 Sep 2021 17:07:49 GMT

@infacto says

“The last crosswalk version is based on Chrome 53” (2016-08) And we have a problem with version 72 (2019-01) users still have. That's really old. How can you app work? ^^

Mon, 06 Sep 2021 17:08:22 GMT

@norman137 says

it doesn't work properly with phones with notches

Mon, 06 Sep 2021 17:08:35 GMT

@norman137 says

cause chrome 53 doesn't support the required css to do safe area insets

Mon, 06 Sep 2021 17:08:59 GMT

@norman137 says

Functionally it works though

Mon, 06 Sep 2021 17:10:02 GMT

@norman137 says

It‘s in the pipelines -- I don’tlike being in a state where we can't just push out an emergency hotfix

Mon, 06 Sep 2021 17:10:10 GMT

@infacto says

The solution is simple: Don‘t use smartphones with notches. Don’t support this! ^^

Mon, 06 Sep 2021 17:10:16 GMT

@norman137 says

๐Ÿ˜†

Mon, 06 Sep 2021 17:11:19 GMT

@norman137 says

we have 3 apps and a massive backend supported by 1 junior developer and me, who does everything else, tech related.

Mon, 06 Sep 2021 17:12:03 GMT

@infacto says

I refuse to buy a smartphone with a notch. Take a look to LG V30. One of the last modern smartphones without a notch and still have thin borders and great screen to body ratio. I hate marketing.

Mon, 06 Sep 2021 17:12:23 GMT

@norman137 says

Yah I hate phones with notches.

Mon, 06 Sep 2021 17:25:45 GMT

@infacto says

Or fat cameras that don't fit into the case. For a thin case:

  • Less battery.
  • Harder to hold.
  • Easier to bend.
  • Impossible to lay flat. Buy buy buy!

Mon, 06 Sep 2021 17:26:16 GMT

@infacto says

bye ^^