Recaptcha on 3.2623 x Print to PDF problems on 3.3497

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.

Recaptcha on 3.2623 x Print to PDF problems on 3.3497

Postby bjutkoski » Tue Oct 23, 2018 12:37 pm

I was using the DCEFBrowser project (https://github.com/himStone/DcefBrowser) (libcef version 3.2623), but since oct, 18th, some recaptchas began to load forever with error: "domexception only secure origins are allowed".
Example: http://www.receita.fazenda.gov.br/Pesso ... itacao.asp

Then I decided to migrate to DCEF4Delphi project (https://github.com/salvadordf/CEF4Delphi) (libcef version 3.3497). Recaptchas are working fine, but some pages with frames are not being printed as I want.
For example:

1 - access: "http://www.receita.fazenda.gov.br/PessoaJuridica/CNPJ/cnpjreva/Cnpjreva_Solicitacao.asp"
2- Fill CNPJ field with 06990590000123 and recaptcha, and click "Consultar".
3 - I want print "Comprovante de Inscrição e de Situação Cadastral" information to a pdf file.

In DCefBrowser project (https://github.com/himStone/DcefBrowser), I do this:
frame := Browser.GetFrame('main')
frame.ExecuteJavaScript('focus();', 'about:blank', 0);
frame.SelectAll;
and call Browser.Host.PrintToPdfProc

And the pdf generated has the frame I want. But doesn't work on DCEF4Delphi. It`s like the focus returns to the mainframe.

On Chromium if I select the frame, with the mouse, and then print, I see that these steps work on preview.


Does anyone know what has changed on recaptcha service? I can fix this?
Or does anyone know how can I print on DCEF4Delphi (3.3497) like was on DCEFBrowser (3.2623)?
bjutkoski
Newbie
 
Posts: 2
Joined: Tue Oct 23, 2018 12:05 pm

Re: Recaptcha on 3.2623 x Print to PDF problems on 3.3497

Postby salvadordf » Tue Oct 23, 2018 3:32 pm

Hi bjutkoski,

Please, test what I commented in the CEF4Delphi forum about setting a "scale_factor" in the pdf settings. I tested it and it works.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: Recaptcha on 3.2623 x Print to PDF problems on 3.3497

Postby bjutkoski » Thu Oct 25, 2018 9:32 am

I tested but the print got too small, and I would have to pass the scale_factor for each page with this problem.

The problem is the new print and printtopdf implemantation, where is always getting the mainframe.
I recompile the libcef.dll getting the focused frame and works fine.
I created a issue with my modifications.
https://bitbucket.org/chromiumembedded/ ... ot-printed

Thank you salvadordf!
bjutkoski
Newbie
 
Posts: 2
Joined: Tue Oct 23, 2018 12:05 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 121 guests