Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

browser.Host.StartDownload and chromium.StartDownload are same?

Post Reply
coater
Posts: 135
Joined: Sat Sep 29, 2018 1:51 pm

browser.Host.StartDownload and chromium.StartDownload are same?

Post by coater »

browser.Host.StartDownload and chromium.StartDownload are same?
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: browser.Host.StartDownload and chromium.StartDownload are same?

Post by salvadordf »

Hi,

They are almost the same but Chromium.StartDownload is safer to use because it checks if the browser is initialized before calling that function.
coater
Posts: 135
Joined: Sat Sep 29, 2018 1:51 pm

Re: browser.Host.StartDownload and chromium.StartDownload are same?

Post by coater »

Thank you very much! :)

I have another question:
If there are some examples for browser scrollbar(not javascript)?
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: browser.Host.StartDownload and chromium.StartDownload are same?

Post by salvadordf »

coater wrote: Mon Mar 18, 2019 1:32 amIf there are some examples for browser scrollbar(not javascript)?
No, sorry. If I remember correctly, the scrollbar can only be modified using JavaScript.
coater
Posts: 135
Joined: Sat Sep 29, 2018 1:51 pm

Re: browser.Host.StartDownload and chromium.StartDownload are same?

Post by coater »

Thank you very much!
mark a function here :roll:
https://stackoverflow.com/questions/139 ... -positions

var
val: ICefV8Value;
context: ICefv8Context;
excp: ICefV8Exception;
scroll: TPoint;
begin
if (Chromium1.Browser.MainFrame = nil) then
exit;

//this will work only with exact frame
context := Chromium1.Browser.MainFrame.GetV8Context;

if (context <> nil) then
begin
context.Eval('window.pageXOffset', val, excp);
scroll.x := val.GetIntValue;
context.Eval('window.pageYOffset', val, excp);
scroll.y := val.GetIntValue;
end
else
exit;

//todo: do something with scroll here
end;


edited Jun 27 '18 at 8:12
answered Nov 18 '13 at 16:18

kormizz
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: browser.Host.StartDownload and chromium.StartDownload are same?

Post by salvadordf »

Thank you for that link!

I'll add those functions to TChromium as soon as I can. :D
Post Reply