tag:blogger.com,1999:blog-5314745381778741517.post6694630153292137954..comments2018-02-04T03:47:12.541+00:00Comments on LazPlanet: Create a Web Browser in Lazarus with Gecko (Part 2)Adnan Shameemnoreply@blogger.comBlogger41125tag:blogger.com,1999:blog-5314745381778741517.post-8596088040952041372017-05-07T17:52:25.509+01:002017-05-07T17:52:25.509+01:00Did you find anything about that problem in openin...Did you find anything about that problem in opening new windows?Leonardo Santoshttps://www.blogger.com/profile/06961130185908855799noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-45713593239622498972017-05-07T17:50:26.656+01:002017-05-07T17:50:26.656+01:00Another thing ... I&#39;m trying to create a butto...Another thing ... I&#39;m trying to create a button that can copy the text that I selected with the mouse in the browser. I thought about the copy and past from clipboard function, but it is not working because it does not seem to identify what I selected in the browser.Leonardo Santoshttps://www.blogger.com/profile/06961130185908855799noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-87392247153146738862017-05-03T20:29:03.439+01:002017-05-03T20:29:03.439+01:00I search some term on this page (as in the example...I search some term on this page (as in the example): <br /><br />http://search.scielo.org/?q=algoritm&amp;where=ORG<br /><br />And the moment I try to access any link in the result, the error message appears.<br /><br />Just like any other page functionality (like export, share, save etc ...)<br /><br />Thanks for listening.Leonardo Santoshttps://www.blogger.com/profile/06961130185908855799noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-52565268261161274262017-05-03T20:00:50.860+01:002017-05-03T20:00:50.860+01:00@Leonardo Santos
This maybe an issue when the pag...@Leonardo Santos<br /><br />This maybe an issue when the page tries to open a new window. I don&#39;t remember where but I saw some code for handling new window with the Gecko component.<br /><br />Can you post the url in which this message appears?<br /><br />RegardsAdnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-85600789425134861672017-05-01T19:24:13.735+01:002017-05-01T19:24:13.735+01:00Hello,
Thanks for such an important tip. I followe...Hello,<br />Thanks for such an important tip. I followed the instructions and successfully created a browser. However, some pages do not open, the following message appears in the program:<br /><br /><b><i>Browser project raised exception class &#39;EGeckoHint&#39; with the message: Chrome flags: FFE<br /><br /><br />In the &#39;CallbackInterfaces.pas&#39; file at line 153:<br />Raise EGeckoHint.CreateFmt (&#39;Attempt to create a new Chrome window but handler does not create a new one. Chrome flags:% 8X&#39;, [chromeFlags]);</i></b><br /><br />I know it may be some component of Chorme, some plugin or add on, but I do not know what it is. Can you help me?Leonardo Santoshttps://www.blogger.com/profile/06961130185908855799noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-34842535842654854152016-12-06T09:36:53.506+00:002016-12-06T09:36:53.506+00:00Is possible to set a proxy in gecko? if yes... how...Is possible to set a proxy in gecko? if yes... how?p. n.https://www.blogger.com/profile/07874576020676096851noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-15913889710586960542016-06-04T06:03:52.482+01:002016-06-04T06:03:52.482+01:00@Luis Henrique Ruthes,
I think you can use Synapse...@Luis Henrique Ruthes,<br />I think you can use Synapse to download files from the internet.<br /><a href="http://wiki.freepascal.org/Synapse" rel="nofollow">http://wiki.freepascal.org/Synapse</a><br /><br />And yes, you can also use TSaveDialog to show where to download that file.Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-63053847464799485672016-06-04T05:56:28.209+01:002016-06-04T05:56:28.209+01:00How to download files on browser,which code of I m...How to download files on browser,which code of I make? I must use TSaveDialog?Luis Henrique Rutheshttps://www.blogger.com/profile/16675716977415527117noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-53016059325681457682015-08-06T12:37:47.083+01:002015-08-06T12:37:47.083+01:00Program work perfect but I have problem. I can not...Program work perfect but I have problem. I can not download files (pdf) through this program. Help.eglownohttps://www.blogger.com/profile/03456887511636523925noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-84336891642814448902015-07-12T14:26:11.552+01:002015-07-12T14:26:11.552+01:00@Ariotomo Satyo
Hello and welcome.
It seems that t...@Ariotomo Satyo<br />Hello and welcome.<br />It seems that the Gecko component didn&#39;t get installed on your Lazarus. Please try to follow <a href="http://lazplanet.blogspot.com/2013/10/browser-in-lazarus-with-gecko-pt1.html" rel="nofollow">part 1</a> instructions to get it installed.<br /><br />Regards.Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-18712499745421487942015-07-09T05:03:02.215+01:002015-07-09T05:03:02.215+01:00Hi, i&#39;m a beginner with lazarus and i have an ...Hi, i&#39;m a beginner with lazarus and i have an error when i compile the code.<br /><br />Compile Project, Target: proj_gecko_test.exe: Exit code 1, Errors: 4<br />frm1.pas(49,3) Error: Identifier not found &quot;Browser&quot;<br />frm1.pas(54,3) Error: Identifier not found &quot;Browser&quot;<br />frm1.pas(59,3) Error: Identifier not found &quot;Browser&quot;<br />frm1.pas(70,3) Error: Identifier not found &quot;Browser&quot;<br /><br />is there something i miss?<br />i tried downloading your source code and compile it with same result.<br /><br />regards,<br />AriAriotomo Satyohttps://www.blogger.com/profile/07324074084576952247noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-1814881784390909722015-06-30T12:10:51.377+01:002015-06-30T12:10:51.377+01:00@Adnan Shameem
Thank You, Yeah. Re-installation so...@Adnan Shameem<br />Thank You, Yeah. Re-installation solved the problem. As far flash is concerned, I checked the page you have mentioned and I am going to check that soon. <br />Another question Please Answer. How to connect through this browser using a proxy server. I searched online but found nothing good. At one site I found code like:<br />Gecko.GeckoPreferences.User(&quot;network.proxy.http&quot;) = &quot;89.248.189.83&quot;<br />Gecko.GeckoPreferences.User(&quot;network.proxy.http_port&quot;) = CInt(&quot;8080&quot;)<br />Gecko.GeckoPreferences.User(&quot;network.proxy.type&quot;) = 1<br />but it is not working in lazarus saying that it can not identify geckopreferences.<br />Thank You Very Much;<br />Adnan Shameem.Rehan Ullahhttps://www.blogger.com/profile/15523505566196276175noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-75828317058988758732015-06-28T09:25:08.876+01:002015-06-28T09:25:08.876+01:00@Rehan Ullah
Nice to have you here.
Well, I have t...@Rehan Ullah<br />Nice to have you here.<br />Well, I have tested the part 2 instructions in my Lazarus 1.4.0. I had no problems running it.<br /><br />From your error message, it seems that the GeckoComponents has not been installed properly. Please check that you have a &quot;Gecko&quot; tab in your components toolbar. I believe that if you re-install GeckoComponents (described in <a href="http://lazplanet.blogspot.com/2013/10/browser-in-lazarus-with-gecko-pt1.html" rel="nofollow">part 1</a>) then the problem will be solved.<br /><br />If I remember correctly, yes you can run flash inside your program. (I am not sure about unity though.) I roughly remember I followed this solution:<br /><a href="https://bitbucket.org/geckofx/geckofx-10.0/issue/20/how-to-use-flash-plugin-in-xulrunner" rel="nofollow">https://bitbucket.org/geckofx/geckofx-10.0/issue/20/how-to-use-flash-plugin-in-xulrunner</a>Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-53881813273113506082015-06-24T12:16:25.499+01:002015-06-24T12:16:25.499+01:00Another Silly Question! Can we make this browser u...Another Silly Question! Can we make this browser use plugins like flash, unity, etc. for viewing videos(as it is not playing dailymotion or youtube right now) and more add-ons like adblock plus etc. I just want to know about the possibility. If it is possible I gonna search and seek by my own and make it do so. You just say that is it possible or not.Rehan Ullahhttps://www.blogger.com/profile/01485599752484381458noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-42979663057989544272015-06-24T11:21:10.569+01:002015-06-24T11:21:10.569+01:00Salam Adnan. I have done everything as you have sa...Salam Adnan. I have done everything as you have said. I have used the same versions which you have mentioned, the same icons, the same names etc. The sample browser mentioned in Part 1 of tutorial works like charm but the self made browser in tutorial part 2 shows an error when I compile it.<br />The error is &quot;frm1.pas(8,32) Fatal: Can not find unit GeckoBrowser used by frm1. Check if package GeckoComponents is in the dependencies.&quot;<br />So what should I do next!! Please Help.<br />I am using windows and lazarus v1.2.6.<br />Rehan Ullahhttps://www.blogger.com/profile/01485599752484381458noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-58853951430897888142015-04-27T15:49:36.516+01:002015-04-27T15:49:36.516+01:00Personally, I can get some information that is loa...Personally, I can get some information that is loaded into the Gecko page. Precise type get a value only the page returns me when I visit a site. Thanks and great article. Site very useful for BraziliansRenato Souzahttps://www.blogger.com/profile/07715950857306815356noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-38829628126220443872014-10-19T10:39:26.911+01:002014-10-19T10:39:26.911+01:00Hi there,
Your guide is working flawlessly in Laz...Hi there,<br /><br />Your guide is working flawlessly in Lazarus ver 1.0.8 running on Win 7.<br /><br />I have managed to embed the gecko browser and was wondering how to export or save the browser content as an HTML file. any ideas from anyone?<br /><br />Regards.<br /><br /><br />ipkwenahttps://www.blogger.com/profile/13930078691666361732noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-69964665005767377142014-04-26T06:27:26.015+01:002014-04-26T06:27:26.015+01:00@rubendaj
pdf.js is one of my favorite projects.
...@rubendaj<br /><br />pdf.js is one of my favorite projects.<br /><br />Well, according to the <a href="https://developer.mozilla.org/en-US/docs/XULRunner_1.9.2_Release_Notes" rel="nofollow">XULRunner 1.9.2 release notes</a> - &quot;XULRunner 1.9.2.x is built from the same source code snapshot as Firefox 3.6.x.&quot;<br /><br />So basically what Firefox version 3.6 can run, our GeckoPort can run it too. I am a little busy right now, so go ahead and test it out yourself.<br /><br /><b>Edit:</b> See these pages for compatibility information:<br />- Required features: <a href="https://github.com/mozilla/pdf.js/wiki/Required-Browser-Features" rel="nofollow">https://github.com/mozilla/pdf.js/wiki/Required-Browser-Features</a><br />- Test if features available: <a href="http://mozilla.github.io/pdf.js/features/" rel="nofollow">http://mozilla.github.io/pdf.js/features/</a><br />- FAQ: <a href="https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support" rel="nofollow">https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support</a>Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-61146421607328517282014-04-22T21:00:45.770+01:002014-04-22T21:00:45.770+01:00Hello Adnan
Very Interesting Job. But I Have a Qu...Hello Adnan<br /><br />Very Interesting Job. But I Have a Question: TGeckoBroser Support HTML5 ? Because I need to run pdf.js<br /><br />thanks in advancerubendajhttps://www.blogger.com/profile/16654608876830752548noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-32854542140295060092014-04-18T07:43:57.314+01:002014-04-18T07:43:57.314+01:00@zbyna
Yes, I can see that you tried so hard. Goo...@zbyna<br /><br />Yes, I can see that you tried so hard. Good to see that you have solved the problem!Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-79477003841745781712014-04-17T18:10:21.957+01:002014-04-17T18:10:21.957+01:00I found solution but a little bit dirty:
I change ...I found solution but a little bit dirty:<br />I change source code of project -<br />unit GeckoBrowser.pas:<br />TCustomGeckoBrowser = class(TCustomControl,IGeckoCreateWindowTarget)<br /> private<br /> // Zbyňa FWebBrowser: nsIWebBrowser;<br /> public<br /> FWebBrowser: nsIWebBrowser; // Zbyňa <br /><br />then this example works:<br /><br />procedure TForm1.BrowserDOMClick(Sender: TObject; aEvent: TGeckoDOMEvent);<br />var<br /> ir:nsIInterfaceRequestor;<br /> mujFocus: nsIWebBrowserFocus;<br /> mujBrowser:nsIWebBrowser;<br /> aktivniElement: nsIDOMElement;<br /> s,s2:IInterfacedString;<br />begin<br /><br /> //Browser.QueryInterface(nsIInterfaceRequestor,ir);<br /> //Browser.ContentWindow.QueryInterface(nsIInterfaceRequestor,ir);<br /> //ir.GetInterface(nsIWebBrowser,mujBrowser);<br /> //ir.GetInterface(NS_IWEBBROWSERFOCUS_IID,mujFocus);<br /> //mujBrowser.QueryInterface(nsIInterfaceRequestor,ir);<br /> //ir.GetInterface(nsIWebBrowserFocus,mujFocus);<br /> mujFocus:=Browser.FWebBrowser as nsIWebBrowserFocus;<br /> if assigned(mujFocus) then<br /> begin<br /> mujFocus.Activate();<br /> aktivniElement:=mujFocus.GetFocusedElement();<br /> s:=newstring(widestring(&#39;id&#39;));<br /> s2:=newstring(widestring(&#39; &#39;));<br /> if Assigned(aktivniElement)then<br /> begin<br /> aktivniElement.GetAttribute(s.AString,s2.AString);<br /> Memo1.Text:=string(sender.ClassName)+ LineEnding +aEvent.name +<br /> LineEnding + s2.ToString;<br /> end;<br /> end;<br />end; <br /><br />In comments you can see my desprite :-) attempts to get this work. zbynahttps://www.blogger.com/profile/04512900753904607765noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-16202365860455645072014-04-16T15:21:30.167+01:002014-04-16T15:21:30.167+01:00I am trying to catch focused element:
procedure TF...I am trying to catch focused element:<br />procedure TForm1.BrowserDOMKeyPress(Sender: TObject; aEvent: TGeckoDOMEvent);<br />var<br /> mujFocus: nsIWebBrowserFocus;<br /> aktivniElement: nsIDOMElement;<br /> s,s2:IInterfacedString;<br />begin<br /> mujFocus:=Browser as nsIWebBrowserFocus;<br /> aktivniElement:=mujFocus.GetFocusedElement();<br /> s:=newstring(widestring(&#39;id&#39;));<br /> s2:=newstring(widestring(&#39; &#39;));<br /> aktivniElement.GetAttribute(s.AString,s2.AString);<br /> Memo1.Text:=string(sender.ClassName)+ &#39; &#39; +aEvent.name + s.ToString;<br />end; <br /><br />but line: mujFocus:=Browser as nsIWebBrowserFocus; seems to be problem<br />runtime error: 219 and then Invalid Cast message<br />It seems I have problems with Gecko SDK object model :-)zbynahttps://www.blogger.com/profile/04512900753904607765noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-65100878651444511762014-04-16T06:28:04.643+01:002014-04-16T06:28:04.643+01:00@zbyna
What are you trying to do? List all HTML e...@zbyna<br /><br />What are you trying to do? List all HTML elements and their attributes?Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-10283309203574672062014-04-15T21:33:43.997+01:002014-04-15T21:33:43.997+01:00Thanks for advice ! It helped me very much.
I have...Thanks for advice ! It helped me very much.<br />I have tried this today and I found<br />these links which describe most of all I wanted to achieve:<br />http://forum.lazarus.freepascal.org/index.php?topic=15352.5;<br />http://forum.lazarus.freepascal.org/index.php/topic,15980.msg86405.html#msg86405<br /><br />I am beginner and I was confused by interfaces in nsXPCOM.pas . It seems<br />to be something like protocols from ObjectiveC.<br /><br />Newertheless if you decide to write some short tutorial on this topic I will appreciate it.<br /><br />I am able to find elements, change them and click buttons from pascal code sofar.<br />zbynahttps://www.blogger.com/profile/04512900753904607765noreply@blogger.comtag:blogger.com,1999:blog-5314745381778741517.post-85626111869417190092014-04-15T11:42:20.771+01:002014-04-15T11:42:20.771+01:00@zbyna,
Did you try something like:
Browser.Conte...@zbyna,<br /><br />Did you try something like:<br />Browser.ContentDocument.Getxxxx...;Adnan Shameemhttps://www.blogger.com/profile/03795435968155667026noreply@blogger.com