URL.createObjectURL() crashes CEF

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

URL.createObjectURL() crashes CEF

Postby scorchloh » Mon Oct 16, 2017 10:04 am

I recently updated CEF to cef_binary_3.3163.1671.g700dc25_windows32 released on 30/09/2017 which uses Chromium version 61.0.3163.91 and my app started crashing. After some debugging i found the problem to be related to URL.createObjectURL. This worked without any trouble on the previous version of CEF that i was using as well as on Chrome version 61.0.3163.100.

Steps to reproduce:


    - Launch a CEF application;
    - Open dev tools;
    - Create a random object e.g. var debug = {hello: "world"};
    - Create a blob using that object e.g. var blob = new Blob([JSON.stringify(debug, null, 2)], {type : 'application/json'});
    - Create an url representing the blob: URL.createObjectURL(blob);
    - App crashes.

Any insight on this? I could't find much about this issue anywhere...
scorchloh
Newbie
 
Posts: 2
Joined: Mon Oct 16, 2017 9:40 am

Re: URL.createObjectURL() crashes CEF

Postby magreenblatt » Mon Oct 16, 2017 12:26 pm

Are you using a Release build? What is the symbolized call stack for the crash?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: URL.createObjectURL() crashes CEF

Postby JoaoCosta » Tue Oct 17, 2017 9:39 am

Hello,

Sorry for hijacking the post but I also have an issue with this method. The environment I am using is also the automated build cef_binary_3.3163.1671.g700dc25_windows32

The app I'm working on uses a custom scheme and domain to answer specific requests. In particular it sets this scheme using the following method

Code: Select all
CefRegisterSchemeHandlerFactory("custom_scheme", "custom_domain", new ClientSchemeHandlerFactory());


One of the app's methods is responsible for creating a png image and sending it to the front-end, who receives this image as an arraybuffer and attempts to create a Blobfrom it and then a URL using URL.createObjectURL(). However, the app crashes upon creating said URL.

I've tried debugging using the console from the dev tools and found out that running the following example crashes the app when it is in a state with the custom_scheme

Code: Select all
var a = "test";
var b = new Blob([a]);
URL.createObjectURL(b);


However, if inside the app I open for example http://www.google.com and use the console to run the previous example code, it doesn't crash.

My assumption is that the URL.createObjectURL is not working due to the custom_scheme.
Is there anything missing rather than just registering the custom_scheme that permits to create the URL?
JoaoCosta
Newbie
 
Posts: 6
Joined: Tue Oct 10, 2017 3:11 am

Re: URL.createObjectURL() crashes CEF

Postby magreenblatt » Tue Oct 17, 2017 6:29 pm

You need to implement OnRegisterCustomSchemes in all processes. See https://bitbucket.org/chromiumembedded/ ... t-handling
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: URL.createObjectURL() crashes CEF

Postby JoaoCosta » Wed Oct 18, 2017 5:43 am

Thank you.

There was some issue with the OnRegisterCustomSchemes implementation.
I re-implemented it and now it is working
JoaoCosta
Newbie
 
Posts: 6
Joined: Tue Oct 10, 2017 3:11 am

Re: URL.createObjectURL() crashes CEF

Postby scorchloh » Fri Oct 20, 2017 3:12 am

That was my problem too. Thanks a lot.
scorchloh
Newbie
 
Posts: 2
Joined: Mon Oct 16, 2017 9:40 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 28 guests