Cef browser dont load my HTML string

Having problems with building or using the JCEF Java binding? Ask your questions here.

Cef browser dont load my HTML string

Postby bozdemir » Fri Mar 20, 2020 5:14 am

Hello,

I just added maven dependency for jcef browser to my java 1.7 project and try to load my html String on the browser. But when browser executed, my html dont show. By the way when i right click on the browser and choose view source, i can see my html code. Here is my implementation;


Code: Select all
        final CefSettings settings = new CefSettings();
        settings.windowless_rendering_enabled = false;

        final CefApp cefApp = CefApp.getInstance(settings);
        final CefClient client = cefApp.createClient();


        final CefBrowser browser = client.createBrowser(
                "data:text/html,<html><body>test text</body></html>",
                useOSR,
                false);

        final Component browserUI = browser.getUIComponent();
        getContentPane().add(browserUI, BorderLayout.CENTER);
        pack();
        setSize(1000, 600);
        this.setVisible(true);


Thanks.
bozdemir
Newbie
 
Posts: 3
Joined: Thu Mar 19, 2020 11:01 am

Re: Cef browser dont load my HTML string

Postby magreenblatt » Fri Mar 20, 2020 10:44 am

What OS and CEF version? Are there any console messages? Are the subprocesses created? Have you tried loading a URL like https://www.google.com?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Cef browser dont load my HTML string

Postby bozdemir » Fri Mar 20, 2020 1:31 pm

magreenblatt wrote:What OS and CEF version? Are there any console messages? Are the subprocesses created? Have you tried loading a URL like https://www.google.com?


My OS is Windows 10 and Cef Version 49.87.win64.2. No there isn't any console messages. and i trired loading URL Like google, youtube and no problem with loading this browsers.
bozdemir
Newbie
 
Posts: 3
Joined: Thu Mar 19, 2020 11:01 am

Re: Cef browser dont load my HTML string

Postby magreenblatt » Fri Mar 20, 2020 2:26 pm

bozdemir wrote:Cef Version 49.87.win64.2

I don't recognize that version number format.

Loading "data:text/html,<html><body>test text</body></html>" from the Address bar in the JCEF detailed app version 80.0.4.244 (Chromium version 80.0.3987.122) results in the following:

[0320/152158.642:ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 213
render process terminated: TS_PROCESS_CRASHED


The window title shows "search://data/html,<html><body>test text</body></html>" which seems odd. Looks like something wrong with the routing of the data URI.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Cef browser dont load my HTML string

Postby bozdemir » Sat Mar 21, 2020 11:40 am

magreenblatt wrote:
bozdemir wrote:Cef Version 49.87.win64.2

I don't recognize that version number format.

Loading "data:text/html,<html><body>test text</body></html>" from the Address bar in the JCEF detailed app version 80.0.4.244 (Chromium version 80.0.3987.122) results in the following:

[0320/152158.642:ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 213
render process terminated: TS_PROCESS_CRASHED


The window title shows "search://data/html,<html><body>test text</body></html>" which seems odd. Looks like something wrong with the routing of the data URI.


Hi.

I took this version from maven as a maven dependency
here is a link:https://mvnrepository.com/artifact/org.bitbucket.johness/java-cef/49.87.win64.2
Before that i tried to create my own jar from bitbucket build and i get Exception in thread "main" java.lang.UnsatisfiedLinkError: no chrome_elf in java.library.path Error.

so im kinda stuck now.
bozdemir
Newbie
 
Posts: 3
Joined: Thu Mar 19, 2020 11:01 am

Re: Cef browser dont load my HTML string

Postby magreenblatt » Sat Mar 21, 2020 2:25 pm

I would suggest not using a data URI. You can load the contents via a CefResourceHandler instead. See examples in the JCEF detailed app.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 23 guests