-
Jun 1st, 2010, 04:32 AM
#1
Thread Starter
PowerPoster
Mozilla / Firefox / Gecko in VB.NET
Here's a very easy to follow tutorial how to implement the Firefox/Gecko plugin within Visual Studio and use it as an IE replacement. It's faster and safer and better then the IE component and no IE or other browser needed on the client-computer to make it work.
These are only the very basics to make it work.
========================================================
1) Download and extract: http://releases.mozilla.org/pub/mozi...n-US.win32.zip
Within the extracted folder You find a folder with the name "xulrunner"
2) Drag the whole folder (including sub-folders and files) to your solution explorer;
3) Now, every file! within the xulrunner-folder need to be Copy To Output Dir -> Copy if Newer
4) Download and extract: http://geckofx.googlecode.com/files/...n.v1.9.1.0.zip
5) Cut/copy the file "Skybound.Gecko.dll" from the bin-folder and place it where ever you want. There is no need for the rest so you can throw that away.
6) Now you need to add the "Skybound.Gecko.dll" to your toolbox.
- right-click the "Toolbox" and select "Choose Items...";
- click "browse" in the ".NET Frameworks components" Tab;
- search for the Skybound.Gecko.dll and press OK; (GeckoWebbrowser appears, see image below. I created a new tab for the component. You can do that also.)
Now we can do stuff:
7) Add the component and a button to your Form;
UPDATED 25-03-2011
-------------------------------------------------------------
8) Open the properties of your application;
9) Click on "View Application Events" in the "Application"-tab;
Copy and past the following:
Code:
Imports Skybound.Gecko
Imports System.IO
Namespace My
' The following events are available for MyApplication:
'
' Startup: Raised when the application starts, before the startup form is created.
' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally.
' UnhandledException: Raised if the application encounters an unhandled exception.
' StartupNextInstance: Raised when launching a single-instance application and the application is already active.
' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
Partial Friend Class MyApplication
Protected Overrides Function OnStartup(ByVal eventArgs As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) As Boolean
Dim ProfileDirectory As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "\subfolder\xulrunner\DefaultProfile"
If Not Directory.Exists(ProfileDirectory) Then
Directory.CreateDirectory(ProfileDirectory)
End If
Xpcom.ProfileDirectory = ProfileDirectory
Dim xrPath As String = System.Reflection.Assembly.GetExecutingAssembly.Location
xrPath = xrPath.Substring(0, xrPath.LastIndexOf("\") + 1) & "\subfolder\xulrunner"
Xpcom.Initialize(xrPath)
Return True
End Function
End Class
End Namespace
You can change the name and path of the folder like you want it to be. This means you can also change the name "xulrunner"
-------------------------------------------------------------
10) Copy and paste the following code into your Form and run:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GeckoWebBrowser1.Navigate("http://www.radjesh.nl")
End Sub
==================================
http://www.mediafire.com/?9s95u1ex9zj4q19 <<< Download example (7MB (.rar))
==================================
That's it.Happy Coding and God Bless
Last edited by Radjesh Klauke; Mar 29th, 2011 at 04:21 AM.
-
Jun 8th, 2010, 09:43 AM
#2
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
Hi,
I have been looking for a way to do this for ages.
I have followed your instructions but every time I try and run the program I get an error box with the following:
network39
However when I check the location the xulrunner folder and files are all there.
Last edited by v7web; Feb 27th, 2012 at 04:56 PM.
-
Jun 9th, 2010, 01:19 AM
#3
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Hmmm... That is really weird. You did call the Initialize component in the Form_load? You are sure that you have copied all the files? Make sure you did.
Code:
Skybound.Gecko.Xpcom.Initialize(Application.StartupPath & "\xulrunner\")
-
Jun 9th, 2010, 02:13 AM
#4
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
Originally Posted by Radjesh Klauke
Hmmm... That is really weird. You did call the Initialize component in the Form_load? You are sure that you have copied all the files? Make sure you did.
Code:
Skybound.Gecko.Xpcom.Initialize(Application.StartupPath & "\xulrunner\")
Hi,
Yes I initialized the code in Form_Load and all files are copied to location.
I am banging my head against the wall here, I really want to use this but just cant see why the files are not being recognised.
Here is a screenshot of my explorer, as you can see the folder has been copied to output (debug) with no problems and all the files/folders are there.
[Removed by moderator]
Last edited by penagate; Feb 27th, 2012 at 06:36 PM.
-
Jun 9th, 2010, 06:32 AM
#5
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Last edited by Radjesh Klauke; Jun 18th, 2010 at 11:54 AM.
-
Jun 9th, 2010, 06:48 AM
#6
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
Thanks Radjesh Klauke
I moved files directly into project solution and changed initial call to:
vb Code:
Skybound.Gecko.Xpcom.Initialize(Application.StartupPath)
All works great now.
Many thanks
-
Jun 9th, 2010, 10:00 AM
#7
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Great to hear. I will adjust the tuto.
-
Jun 18th, 2010, 11:48 AM
#8
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
What are the methods from this API ?
-
Jun 18th, 2010, 11:53 AM
#9
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
-
Jul 7th, 2010, 06:27 AM
#10
Member
Re: Mozilla / Firefox / Gecko in VB.NET
Thanks for sharing can you tell me which is ProgressChanged Event in it ?? there is no ProgressChanged any alternative in this.
also tell me if I delete IE and Firefox did my project work now ??
-
Jul 9th, 2010, 04:38 PM
#11
Frenzied Member
Re: Mozilla / Firefox / Gecko in VB.NET
Very interesting if this actually works. Does it also include the JavaScript engine, not just the HTML rendering?
-
Jul 15th, 2010, 12:56 PM
#12
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
is there a faster way to do this: Copy To Output Dir -> Copy if Newer
-
Jul 15th, 2010, 02:45 PM
#13
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
i noticed that when playing youtube videos in this browser the volume is extremely low...(i played the same videos in chrome and it was regular loud) Can i fix this?
-
Aug 21st, 2010, 02:46 AM
#14
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Sorry for the late reply, but I really don't know. Try to ask that on the forum of GeckoFX.
-
Aug 21st, 2010, 02:49 AM
#15
Member
Re: Mozilla / Firefox / Gecko in VB.NET
I am unable to show Context Menu in Gecko Web browser. Also i don't find any help on Geckofx forum. Please any one here can solve my problem. is there any why to show context menu
i am using xurlrunner 1.9.1
-
Aug 21st, 2010, 03:34 AM
#16
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
You didn't search: http://geckofx.org/viewtopic.php?id=595
Register and ask there.
-
Aug 21st, 2010, 04:44 AM
#17
Member
Re: Mozilla / Firefox / Gecko in VB.NET
i have asked there many time and also related threads are there but no solution !!!
Plz......
-
Aug 22nd, 2010, 06:13 AM
#18
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
This is not the place to ask for help regarding the dll itself. This only shows how to implement it.
-
Aug 23rd, 2010, 04:07 AM
#19
Member
Re: Mozilla / Firefox / Gecko in VB.NET
Originally Posted by dewshare
Thanks for sharing can you tell me which is ProgressChanged Event in it ?? there is no ProgressChanged any alternative in this.
also tell me if I delete IE and Firefox did my project work now ??
Try this:
Code:
Private Sub Browser_ProgressChanged(ByVal sender As Object, ByVal e As Skybound.Gecko.GeckoProgressEventArgs) Handles Browser.ProgressChanged
ToolStripProgressBar1.Maximum = e.MaximumProgress
ToolStripProgressBar1.Value = e.CurrentProgress
End Sub
-
Aug 25th, 2010, 02:46 PM
#20
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Hi there.
I hope you can help me. I have no problem in initializing the program and do not get any nasty messages. However, when the form comes up, it doesn't do anything even if I push the button. Using the following command:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
GeckoWebBrowser1.Navigate("http://www.comcast.net")
End Sub
Thank you.
-
Aug 25th, 2010, 03:41 PM
#21
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
That's weird, but your button_code isn't correct. It should be:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
What code do you have in the Form_Load?
-
Aug 25th, 2010, 05:14 PM
#22
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Thanks. That Handled the problem. I am a Bone Brain sometimes.
-
Oct 15th, 2010, 07:17 AM
#23
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Hi
I'm kind of new to this whole 'gecko' usage - but I attempted to use it in my project in Visual Basic 2008 (Express Edition) and it keeps turning up this same error...
Error 1 "chrome\classic.manifest;chrome\comm.manifest;chrome\en-US.manifest;chrome\pippki.manifest;chrome\toolkit.manifest;Microsoft.VC80.CRT.manifest" is an invalid value for the "InputManifest" parameter of the "GenerateApplicationManifest" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". GeckoBrowser
I have not edited any of the files they have provided and I am currently using Windows XP with .NET framework 4 and 3.5 SP1 installed...
If someone could please help me out - It would be much appreciated...
-
Oct 15th, 2010, 08:15 AM
#24
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Means that you didn't do as the tutorial said.
To be sure: Create a new project and follow the tutorial again.
-
Oct 15th, 2010, 09:29 AM
#25
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Thank you for replying so soon...
But although I tried it multiple times each time in new projects, the same error comes up...
I even tried another project: http://www.planet-source-code.com/vb...20109162039576
But still, when I try to publish the project, the error turns up (ONLY when I try to publish... I can run it fine... But cannot publish...)
Thanks for your help in advance...
-
Oct 15th, 2010, 11:44 AM
#26
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Does this also occur during debugging?
Can you upload the project without any .exe?
-
Oct 16th, 2010, 12:33 PM
#27
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Actually, no - the error only appears after I've tried to publish it... Debugging works fine... And as I said - I've tried it with some other projects which use Gecko as well - and they all work fine, until I try to publish it of course...
The files seemed too big to upload here - so here's a link:
http://www.4shared.com/file/hQ0IzXvq/GeckoBrowser.html
-
Oct 16th, 2010, 09:41 PM
#28
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
??? I need to pay to download....
Are you kidding me? I won't help you anymore!
-
Oct 17th, 2010, 04:04 AM
#29
New Member
Re: Mozilla / Firefox / Gecko in VB.NET
Really sorry...
But no - you don't have to pay actually - you just have to wait 30 seconds and it gives the download link, I didn't know where else to upload the file...
Anyways... It's alright if you are too busy - I'm using the internet explorer component for now...
-
Nov 4th, 2010, 03:28 PM
#30
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
-
Mar 25th, 2011, 03:10 PM
#31
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Updated the tutorial. Now you can add the full folder to your project and give the folder the name you want and place it where ever you want. Make sure you change the path (and name) of the folder in the ApplicationEvents.vb.
-
Mar 27th, 2011, 06:22 PM
#32
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
I don't know what i did wrong but everything is were it should and such. I added GeckoWebBrowser1.navigate("http://www.google.com") to a button click event and when i click the button it makes an error and acts as though it was null. Can u help me with this? i am trying to implement gecko into an existing project. It is a new form though.
[ERROR LOG REMOVED TO SAVE SPACE]
Last edited by crazy1993; Mar 30th, 2011 at 03:08 PM.
Reason: [ERROR LOG REMOVED TO SAVE SPACE]
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Mar 28th, 2011, 01:36 AM
#33
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
I don't know what you have done so I can't help you with the info you provided.
You should provide code.
Last edited by Radjesh Klauke; Mar 28th, 2011 at 03:19 AM.
-
Mar 28th, 2011, 01:38 PM
#34
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
So silly of me. My bad.
AppilicationEvents.vb
vb Code:
Imports Skybound.Gecko Imports System.IO Namespace My Partial Friend Class MyApplication Protected Overrides Function OnStartup(ByVal eventArgs As _ Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) As Boolean Dim ProfileDirectory As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & _ "\MY COMPANY\MY APPLICATION\DefaultProfile" If Not System.IO.File.Exists(ProfileDirectory) Then System.IO.Directory.CreateDirectory(ProfileDirectory) End If Dim xrPath As String = System.Reflection.Assembly.GetExecutingAssembly.Location xrPath = xrPath.Substring(0, xrPath.LastIndexOf("\") + 1) & "xulrunner" Xpcom.Initialize(xrPath) Return True End Function End Class End Namespace
Form_Browser.vb
vb Code:
Public Class Form_Browser Private Sub Form_Browser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub ButtonGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGo.Click GeckoWebBrowser1.Navigate("http://google.com") End Sub End Class
My error occurs when I click the button to navigate. When i press F5 to start debugging i don't get the message box that says it did not find xulrunner so I am not sure what my problem
Last edited by crazy1993; Mar 28th, 2011 at 01:40 PM.
Reason: Cleanup
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Mar 29th, 2011, 04:05 AM
#35
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
You didn't change the paths. besides that.... it isn't the code I provided... :s
Last edited by Radjesh Klauke; Mar 29th, 2011 at 04:21 AM.
-
Mar 29th, 2011, 04:19 AM
#36
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
I've created an example. The downloadlink can be found in the original post.
-
Mar 29th, 2011, 11:13 AM
#37
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
Thanks for the example but things still are not working when I copy it to my own program. I copied the gecko dll u use and the xulrunner. It works fine in yours but not mine. I uploaded it to my website, if you have time could you take a look? Appreciate it.
URL REMOVED - NO LONGER VALID
Last edited by crazy1993; Mar 30th, 2011 at 03:09 PM.
Reason: Link fix - REmoved error removed files
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Mar 29th, 2011, 02:53 PM
#38
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
The url you provided isn't valid. Please check things. I have more to do.
-
Mar 29th, 2011, 04:19 PM
#39
Lively Member
Re: Mozilla / Firefox / Gecko in VB.NET
Link Fixed. It prob didn't work cuz i didn't make it a link i just typed it out. I was on my iphone and class was about to start. Sorry about that. Thanks for your time!
LINK REMOVED - NO LONGER VALID
Last edited by crazy1993; Mar 30th, 2011 at 03:10 PM.
Reason: Removed link
~Dustin Schreiber
Head Developer for TechJive Dev Team - Founder of http://www.thetechsphere.com
Who *cares* if a laser guided 500 lb bomb is accurate to within 9 feet?
Teamwork is essential. It gives the enemy someone else to shoot at.
Retreating?! Hell no, we're just attacking the other direction!
Please rate posts if you find them helpful
<--- Over there genius
-
Mar 30th, 2011, 01:46 AM
#40
Thread Starter
PowerPoster
Re: Mozilla / Firefox / Gecko in VB.NET
Sorry, but I can't test your app. I'm getting loads of errors when I try to debug it. I suggest you create a new project yourself and first test if it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|