add navigation bar

-added navigation bar into the browser
-remove debug copy of the HTML document while closing the browser
This commit is contained in:
hama3254 2020-01-03 23:14:07 +01:00
parent d6ea075144
commit 679ad417f6
12 changed files with 55 additions and 7 deletions

Binary file not shown.

View File

@ -23,23 +23,44 @@ Partial Class GeckoFX
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.WebBrowser1 = New Gecko.GeckoWebBrowser() Me.WebBrowser1 = New Gecko.GeckoWebBrowser()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.SuspendLayout() Me.SuspendLayout()
' '
'WebBrowser1 'WebBrowser1
' '
Me.WebBrowser1.ConsoleMessageEventReceivesConsoleLogCalls = True Me.WebBrowser1.ConsoleMessageEventReceivesConsoleLogCalls = True
Me.WebBrowser1.FrameEventsPropagateToMainWindow = False Me.WebBrowser1.FrameEventsPropagateToMainWindow = False
Me.WebBrowser1.Location = New System.Drawing.Point(0, 0) Me.WebBrowser1.Location = New System.Drawing.Point(0, 30)
Me.WebBrowser1.Name = "WebBrowser1" Me.WebBrowser1.Name = "WebBrowser1"
Me.WebBrowser1.Size = New System.Drawing.Size(1280, 720) Me.WebBrowser1.Size = New System.Drawing.Size(1280, 720)
Me.WebBrowser1.TabIndex = 0 Me.WebBrowser1.TabIndex = 0
Me.WebBrowser1.UseHttpActivityObserver = False Me.WebBrowser1.UseHttpActivityObserver = False
' '
'TextBox1
'
Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox1.Location = New System.Drawing.Point(99, 1)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(1178, 26)
Me.TextBox1.TabIndex = 1
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(0, 1)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 26)
Me.Button1.TabIndex = 2
Me.Button1.Text = "Enter"
Me.Button1.UseVisualStyleBackColor = True
'
'GeckoFX 'GeckoFX
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1279, 720) Me.ClientSize = New System.Drawing.Size(1279, 750)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.WebBrowser1) Me.Controls.Add(Me.WebBrowser1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False Me.MaximizeBox = False
@ -48,8 +69,11 @@ Partial Class GeckoFX
Me.ShowIcon = False Me.ShowIcon = False
Me.Text = "GeckoFX-Firefox-Browser" Me.Text = "GeckoFX-Firefox-Browser"
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout()
End Sub End Sub
Public WithEvents WebBrowser1 As Gecko.GeckoWebBrowser Public WithEvents WebBrowser1 As Gecko.GeckoWebBrowser
Friend WithEvents TextBox1 As TextBox
Friend WithEvents Button1 As Button
End Class End Class

View File

@ -9,6 +9,10 @@ Public Class GeckoFX
Public c As Boolean = True Public c As Boolean = True
Dim t As Thread Dim t As Thread
Private Sub GeckoWebBrowser1_DocumentCompleted(sender As Object, e As EventArgs) Handles WebBrowser1.DocumentCompleted Private Sub GeckoWebBrowser1_DocumentCompleted(sender As Object, e As EventArgs) Handles WebBrowser1.DocumentCompleted
Try
TextBox1.Text = WebBrowser1.Url.ToString
Catch ex As Exception
End Try
'My.Computer.Clipboard.SetText(WebBrowser1.Document.Body.InnerHtml) 'My.Computer.Clipboard.SetText(WebBrowser1.Document.Body.InnerHtml)
'Try 'Try
' Dim ads_add As String = My.Resources.ads_preroll ' Dim ads_add As String = My.Resources.ads_preroll
@ -43,11 +47,11 @@ Public Class GeckoFX
'Dim cookieFillValue As String = "enUS" 'Dim cookieFillValue As String = "enUS"
'WebBrowser1.Document.Cookie = String.Format("{0}={1}; {2}", cookieFillName, cookieFillValue, WebBrowser1.Document.Cookie) 'WebBrowser1.Document.Cookie = String.Format("{0}={1}; {2}", cookieFillName, cookieFillValue, WebBrowser1.Document.Cookie)
WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "session_id=" + keks + "; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";") WebBrowser1.Navigate("javascript:document.cookie =" + Chr(34) + "session_id=" + keks + "; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(2) Main.Pause(1)
WebBrowser1.Navigate("javascript:document.cookie = " + Chr(34) + "sess_id=" + keks + "; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";") WebBrowser1.Navigate("javascript:document.cookie = " + Chr(34) + "sess_id=" + keks + "; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(2) Main.Pause(1)
WebBrowser1.Navigate("javascript:document.cookie = " + Chr(34) + "c_locale=enUS; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";") WebBrowser1.Navigate("javascript:document.cookie = " + Chr(34) + "c_locale=enUS; expires=Thu, 05 Jan 2021 00:00:00 UTC; path=/;" + Chr(34) + ";")
Main.Pause(2) Main.Pause(1)
'WebBrowser1.Navigate("javascript:alert(document.cookie);") 'WebBrowser1.Navigate("javascript:alert(document.cookie);")
'Main.Pause(2) 'Main.Pause(2)
WebBrowser1.Navigate("https://www.crunchyroll.com/") WebBrowser1.Navigate("https://www.crunchyroll.com/")
@ -226,9 +230,29 @@ Public Class GeckoFX
End Sub End Sub
Private Sub GeckoFX_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing Private Sub GeckoFX_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
My.Computer.Clipboard.SetText(WebBrowser1.Document.Body.InnerHtml) 'My.Computer.Clipboard.SetText(WebBrowser1.Document.Body.InnerHtml)
Main.UserBowser = False Main.UserBowser = False
End Sub End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Catch ex As Exception
End Try
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
Try
If Asc(e.KeyChar) = 13 Then
WebBrowser1.Navigate(TextBox1.Text)
End If
Catch ex As Exception
End Try
End Sub
End Class End Class

View File

@ -33,5 +33,5 @@ Imports System.Runtime.InteropServices
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.0.1")> <Assembly: AssemblyVersion("3.0.1")>
<Assembly: AssemblyFileVersion("3.0.2")> <Assembly: AssemblyFileVersion("3.0.3")>
<Assembly: NeutralResourcesLanguage("")> <Assembly: NeutralResourcesLanguage("")>