Empty webview

Hello everyone! I have the next issue:
I made the Google authentication window. In IDE the window looks pretty good, but as I built the snap, this window become “empty”. Note when I hover cursor on a text field, button or something else, the cursor changes its icon.

How it looks in IDE

How it looks after building

snapcraft.yaml
name: deletebg
base: core18
version: ‘2.10.e’
summary: Delete Background is an easy service for quickly editing your images.
icon: snap/gui/icon.png
license: ‘MIT’
compression: lzo
description: |

grade: stable
confinement: strict

    parts:
      deletebg:
        plugin: maven
        source: .
        source-type: local
        stage-packages:
          - openjdk-11-jdk
    #      - openjfx
          - libopenjfx-jni

    apps:
      deletebg:
    #    extensions:
    #      - gnome-3-28
        command: bin/java -jar $SNAP/jar/deletebg-2.10.e.jar
        plugs:
          - desktop-legacy
          - desktop
          - home
          - network
          - browser-support

Is there a reason the gnome-3-28 extension is commented out?

That was an experiment. But the window is empty even when extension is included

do you see any errors if you watch with jounralctl -f while running the app or is there anything in the terminal when you run it from cmdline ?

There are no errors :frowning:

does it work if you install it with --devmode ?

It doesn’t even with --devmode :frowning:

so we can rule out confinement issues at least …

What about devmode and with the extension ;)? There’s also the gnome-3-34 extension that might fair differently.

Also you could save some space by replacing openjdk-11-jdk with openjdk-11-jre, the JDK components are probably not useful to the built snap.

So I changed the snapcraft.yam file:

name: deletebg
base: core18
version: '2.10.e'
summary: Delete Background is an easy service for quickly editing your images.
icon: snap/gui/icon.png
license: 'MIT'
description:   ...

grade: stable
confinement: devmode

parts:
  deletebg:
    plugin: maven
    source: .
    source-type: local
    stage-packages:
      - openjdk-11-jre
      - openjfx
      - libopenjfx-jni

apps:
  deletebg:
    extensions:
      - gnome-3-28
    command: bin/java -jar $SNAP/jar/deletebg-2.10.e.jar
    plugs:
      - desktop-legacy
      - desktop
      - home
      - network
      - browser-support

Built and ran the application and the window still empty :frowning:

have you tried the gnome-3-34 extension instead of 3-28, like james suggested ?

I tried. The same result

Is there any chance you could submit this onto the edge channel or via a branch release so we could take a look locally at any terminal output ourselves? (I’m assuming the app is closed source or I’d have tried building myself).

I can release the application onto the edge channel

Having tried your latest edge build upload, what stands out to me is that the Facebook login option actually loads the web page fine, although the Facebook login also states the browser is old.

At a guess, Google has started rejecting logins from certain user-agents that aren’t traditional browser strings whereas Facebook is (presumably) more lenient here. The fact Google works outside of snap but doesn’t work inside snap likely comes down to core18 using an older version of Webkit, and the host version being new enough to be considered acceptable (or maybe has other patches to work around certain problems).

It might be worth trying to see if this works in Core20 with Gnome-3-38 extensions. The Maven plugin doesn’t exist in Core20 yet iirc, but you could probably just dump your .jar file made in the host as a means of testing this for now.

But fundamentally, I don’t think snap sandboxing is interfering here as much as that dependencies themselves are old and the services you’re trying to use are picky, so the answer lies in bundling newer dependencies rather than confinement IMO.

Also relevant:

So I tried to change the core to the core20 with extensions: gnome-3-28. As the result I got error:

Failed to load extension ‘gnome-3-28’: this extension does not support the ‘core20’ base.
Either use a different extension, or use a base supported by this extension.

It’s gnome-3-38 (thirty eight)

The previous extensions are core18 exclusives.

If a java component is loading the webview, it might need some tweaking, if it is gnome webkit using the extension should provide the right setup.

So I tried to enter email in authentication window blindly. As I entered email I got an error in terminal:

java.nio.BufferUnderflowException
at java.base/java.nio.Buffer.nextGetIndex(Buffer.java:651)
at java.base/java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:750)
at com.sun.webkit.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:114)
at com.sun.webkit.graphics.WCRenderQueue.decode(WCRenderQueue.java:92)
at com.sun.webkit.WebPage.paint2GC(WebPage.java:729)
at com.sun.webkit.WebPage.paint(WebPage.java:696)
at com.sun.javafx.sg.prism.web.NGWebView.renderContent(NGWebView.java:95)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:479)
at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:328)
at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.base/java.lang.Thread.run(Thread.java:829)