calling javascript function with geckobrowser lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- tormods · 2015-09-06 11:08 can anybody give me a hint on how to call a javascript function from lazarus using geckobrowser. I need this to be able to manipulate google maps from lazarus. does anyone know of samples or tutorials, even documentation on howto use geckobrowser in lazarus. tormods ---------------------------------------------------------------------- derek.john.evans · 2015-09-06 12:00 Based on how I do it using TAxcWebBrowser, I'd say the search keywords are: TGeckoBrowser DocumentElement parentWindow execScript But, I cant find anything. I can tell you how I do it using TAxcWebBrowser, which should/may convert to TGeckoBrowser. I grab the document & then the window using something like: Code: [Select]var   LBrowser: TAxcWebBrowser;   document, window: OleVariant;   document :=  LBrowser.OleServer.Document;   window := document.parentWindow; With the window, I can use execScript() to run a script. I use a window variant to return the results: Code: [Select]  var AScript: Olevariant;   window.execScript('var ExecResult=' + AScript);   Result := window.ExecResult;      So, how would this convert? If Geckos nsIDOMDocument provides a compatible document interface, then: Code: [Select]var   LBrowser: TGeckoBrowser;   document, window: OleVariant;   document :=  LBrowser.ContentDocument.DocumentElement;   window := document.parentWindow; ---------------------------------------------------------------------- BlueIcaro · 2015-09-06 17:08 @Geepster can you open a new issue explain how to use TAxcWebBrowser in Lazarus? @tormods I'm sorry for the offtopic Thanks /BlueIcaro ---------------------------------------------------------------------- derek.john.evans · 2015-09-06 17:44 Quote from: BlueIcaro on September 06, 2015, 07:08:55 pm@Geepster can you open a new issue explain how to use TAxcWebBrowser in Lazarus? There is information about importing the internet explorer activex control here: http://wiki.lazarus.freepascal.org/LazActiveX - Open 'Import Type Library' from the tools menu and select 'C:\WINDOWS\system32\ieframe.dll'. Click OK. The SHDocVw_1_1_TLB unit is created. The only change I'd make is using "Create visual component (TActiveXContainer descendant)" to create TAxcWebBrowser. Once you have TAxcWebBrowser, google anything about Delphi TWebBrowser, or IWebBrowser. Once you get the document (using document := LBrowser.OleServer.Document) , then, all kinds of possibilities open up. What ever is exposed by the underlining document interface, is available. And the interface is somewhat well documented, since its the same interface exposed to JavaScript. Anyway, the point being. If Gecko provides a IHTMLDocument style interface, then you should be able to call the same commands available in JavaScript. For me, its all kinda freaky writing code (late binding) in Lazarus/Delphi which runs though a interface. Cool and freaky. ---------------------------------------------------------------------- dcminus · 2016-03-23 17:31 @tormods: did you managed to get this working? Please share. CHEERS!