forked from Walkman100/BasicBrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicBrowser.vb
452 lines (389 loc) · 21.3 KB
/
BasicBrowser.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
Imports Skybound.Gecko
Public Class BasicBrowser
' Made by ░▒▓█│【Walkman】│█▓▒░
'use `CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser)` to refer to the webbrowser on the active tab
' Copied from the designer, so i can get resources at RunTime
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(BasicBrowser))
Public openWithURI As String
Dim TabToClose As Integer
Private Sub BasicBrowser_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For Each s As String In My.Application.CommandLineArgs
If openWithURI = "" Then
openWithURI = s
Else
openWithURI = openWithURI & s
End If
Next
For i = 1 To My.Settings.Favourites.Count
ToolStripURL.Items.Add(My.Settings.Favourites.Item(i - 1))
Next
NewTab(Nothing, Nothing)
End Sub
' MenuStrip options
'File
Sub NewTab(sender As Object, e As EventArgs) Handles ToolStripNewTab.Click, MenuStripFileNew.Click
Dim TabPage As New TabPage()
Dim WebBrowser As New GeckoWebBrowser
AddHandler WebBrowser.Navigating, New GeckoNavigatingEventHandler(AddressOf Navigate)
AddHandler WebBrowser.Navigated, New GeckoNavigatedEventHandler(AddressOf Navigate)
AddHandler WebBrowser.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf DocumentCompleted)
AddHandler WebBrowser.ProgressChanged, New GeckoProgressEventHandler(AddressOf ProgressChanged)
AddHandler WebBrowser.StatusTextChanged, AddressOf StatusTextChanged
AddHandler WebBrowser.DocumentTitleChanged, AddressOf DocumentTitleChanged
AddHandler WebBrowser.CanGoBackChanged, AddressOf PerformStuff
AddHandler WebBrowser.CanGoForwardChanged, AddressOf PerformStuff
'AddHandler WebBrowser.MouseClick, New MouseEventHandler(AddressOf WebBrowserMouseClick)
'AddHandler WebBrowser.ShowContextMenu, New GeckoContextMenuEventHandler(AddressOf WebBrowserShowContextMenu)
TabPage.Text = "Loading..."
TabControl.TabPages.Add(TabPage)
TabControl.SelectTab(TabControl.TabCount - 1)
WebBrowser.Parent = TabPage
WebBrowser.Dock = DockStyle.Fill
WebBrowser.Visible = True
WebBrowser.ContextMenuStrip = WBContextMenu
If openWithURI = "" Then
WebBrowser.Navigate("https://google.com")
Else
WebBrowser.Navigate(openWithURI)
openWithURI = ""
End If
ToolStripReload.Enabled = True
ToolStripHome.Enabled = True
ToolStripCloseTab.Enabled = True
ToolStripGo.Enabled = True
ToolStripURL.Enabled = True
ToolStripAdd.Enabled = True
ToolStripRemove.Enabled = True
MenuStripFileCloseTab.Enabled = True
MenuStripFileOpen.Enabled = True
MenuStripFileSave.Enabled = True
MenuStripFilePrint.Enabled = True
MenuStripFilePrintPreview.Enabled = True
MenuStripViewSource.Enabled = True
MenuStripToolsProperties.Enabled = True
End Sub
Private Sub CloseTab(sender As Object, e As EventArgs) Handles ToolStripCloseTab.Click, MenuStripFileCloseTab.Click
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Navigate("about:blank") ' To make sure it doesn't take up extra memory
TabToClose = TabControl.SelectedIndex
If TabControl.TabCount > 1 Then
' If you have selected the first tab, select the second tab
If TabControl.SelectedIndex = 0 Then
TabControl.SelectTab(1)
' If you have selected the last tab, select the second last tab
ElseIf TabControl.TabCount = TabControl.SelectedIndex + 1 Then
TabControl.SelectTab(TabControl.SelectedIndex - 1)
Else 'Else select the next tab
TabControl.SelectTab(TabControl.SelectedIndex + 1)
End If
End If
TabControl.TabPages.RemoveAt(TabToClose)
If TabControl.TabCount = 0 Then
ToolStripBack.Enabled = False
ToolStripForward.Enabled = False
ToolStripReload.Enabled = False
ToolStripStop.Enabled = False
ToolStripHome.Enabled = False
ToolStripCloseTab.Enabled = False
ToolStripGo.Enabled = False
ToolStripURL.Enabled = False
ToolStripAdd.Enabled = False
ToolStripRemove.Enabled = False
MenuStripFileCloseTab.Enabled = False
MenuStripFileOpen.Enabled = False
MenuStripFileSave.Enabled = False
MenuStripFilePrint.Enabled = False
MenuStripFilePrintPreview.Enabled = False
MenuStripViewSource.Enabled = False
MenuStripToolsProperties.Enabled = False
Else
PerformStuff()
End If
End Sub
Private Sub MenuStripFileNewWindow_Click(sender As Object, e As EventArgs) Handles MenuStripFileNewWindow.Click
Dim NewWindow As BasicBrowser = New BasicBrowser
NewWindow.Show()
End Sub
Private Sub MenuStripFileCloseWindow_Click(sender As Object, e As EventArgs) Handles MenuStripFileCloseWindow.Click
For i = 1 To TabControl.TabCount
CType(TabControl.TabPages.Item(0).Controls.Item(0), GeckoWebBrowser).Navigate("about:blank")
TabControl.TabPages.RemoveAt(0)
Next
Me.Close()
End Sub
Private Sub MenuStripFileOpen_Click(sender As Object, e As EventArgs) Handles MenuStripFileOpen.Click
Dim OpenFileDialog As New OpenFileDialog()
OpenFileDialog.FileName = ""
OpenFileDialog.Filter = "Webpages|*.html|All Files|*.*"
OpenFileDialog.Title = "Open Webpage"
If (OpenFileDialog.ShowDialog() = DialogResult.OK) Then
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).DocumentText = System.IO.File.ReadAllText(OpenFileDialog.FileName)
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Document = System.IO.File.ReadAllText(OpenFileDialog.FileName)
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Document.Body = System.IO.File.ReadAllText(OpenFileDialog.FileName)
' Apparently these properties either don't exist (DocumentText) or are read-only, so they have been disabled so that the project is compileable.
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Navigate(OpenFileDialog.FileName)
End If
End Sub
Private Sub MenuStripFileSave_Click(sender As Object, e As EventArgs) Handles MenuStripFileSave.Click
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ShowSaveAsDialog() ' Valid only for WinForms WebBrowser control
Dim SaveFileDialog As New SaveFileDialog()
SaveFileDialog.FileName = ""
SaveFileDialog.Filter = "Webpages|*.html|All Files|*.*"
SaveFileDialog.Title = "Open Webpage"
If (SaveFileDialog.ShowDialog() = DialogResult.OK) Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).SaveDocument(SaveFileDialog.FileName)
End If
End Sub
Private Sub MenuStripFilePrint_Click(sender As Object, e As EventArgs) Handles MenuStripFilePrint.Click
Dim PrintDialog As New PrintDialog
Dim PrintDocument As New System.Drawing.Printing.PrintDocument
'PrintDocument = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Document
PrintDialog.Document = PrintDocument
If (PrintDialog.ShowDialog() = DialogResult.OK) Then
PrintDocument.PrinterSettings = PrintDialog.PrinterSettings
PrintDocument.Print()
End If
End Sub
Private Sub MenuStripFilePrintPreview_Click(sender As Object, e As EventArgs) Handles MenuStripFilePrintPreview.Click
Dim PrintPreviewDialog As New PrintPreviewDialog
'PrintPreviewDialog.Document = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Document
PrintPreviewDialog.Show()
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub ExitBasicBrowser(sender As Object, e As EventArgs) Handles MenuStripFileExit.Click
MenuStripFileCloseWindow_Click(Nothing, Nothing)
Application.Exit()
End Sub
'Edit
Private Sub MenuStripEditUndo_Click(sender As Object, e As EventArgs) Handles MenuStripEditUndo.Click
If ToolStripURL.Focused = True Then
'ToolStripURL.Undo()
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Undo()
End If
End Sub
Private Sub MenuStripEditRedo_Click(sender As Object, e As EventArgs) Handles MenuStripEditRedo.Click
If ToolStripURL.Focused = True Then
'ToolStripURL.Redo()
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Redo()
End If
End Sub
Private Sub MenuStripEditCut_Click(sender As Object, e As EventArgs) Handles MenuStripEditCut.Click
If ToolStripURL.Focused = True Then
If ToolStripURL.SelectedText = "" Then
Clipboard.SetText(ToolStripURL.Text)
ToolStripURL.Text = ""
Else
Clipboard.SetText(ToolStripURL.SelectedText)
ToolStripURL.Text = ToolStripURL.Text.Remove(ToolStripURL.SelectionStart, ToolStripURL.SelectionLength)
End If
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).CutSelection()
End If
End Sub
Private Sub MenuStripEditCopy_Click(sender As Object, e As EventArgs) Handles MenuStripEditCopy.Click
If ToolStripURL.Focused = True Then
If ToolStripURL.SelectedText = "" Then
Clipboard.SetText(ToolStripURL.Text)
Else
Clipboard.SetText(ToolStripURL.SelectedText)
End If
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).CopySelection()
End If
End Sub
Private Sub MenuStripEditPaste_Click(sender As Object, e As EventArgs) Handles MenuStripEditPaste.Click
If ToolStripURL.Focused = True Then
ToolStripURL.Text = ToolStripURL.Text.Remove(ToolStripURL.SelectionStart) & Clipboard.GetText & ToolStripURL.Text.Substring(ToolStripURL.SelectionStart)
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Paste()
End If
End Sub
Private Sub MenuStripEditSelectAll_Click(sender As Object, e As EventArgs) Handles MenuStripEditSelectAll.Click
If ToolStripURL.Focused = True Then
ToolStripURL.SelectAll()
ElseIf TabControl.TabCount <> 0 Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).SelectAll()
End If
End Sub
'View
Private Sub MenuStripViewKeepOnTop_CheckedChanged(sender As Object, e As EventArgs) Handles MenuStripViewKeepOnTop.CheckedChanged
Me.TopMost = MenuStripViewKeepOnTop.Checked
End Sub
Private Sub MenuStripViewOpacityLbl_Click(sender As Object, e As EventArgs) Handles MenuStripViewOpacityLbl.Click
MenuStripViewOpacityCbx.Focus()
End Sub
Private Sub MenuStripViewOpacityCbx_TextChanged(sender As Object, e As EventArgs) Handles MenuStripViewOpacityCbx.TextChanged
Me.Opacity = MenuStripViewOpacityCbx.Text.Remove(MenuStripViewOpacityCbx.Text.LastIndexOf("%")) / 100
End Sub
Private Sub MenuStripViewSource_Click(sender As Object, e As EventArgs) Handles MenuStripViewSource.Click
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ViewSource() ' Woah cool, one line instead of loads :D
End Sub
'Tools
Private Sub MenuStripToolsSetup_Click(sender As Object, e As EventArgs) Handles MenuStripToolsSetup.Click
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ShowPageSetupDialog()
openWithURI = "about:config"
NewTab(Nothing, Nothing)
End Sub
Private Sub MenuStripToolsProperties_Click(sender As Object, e As EventArgs) Handles MenuStripToolsProperties.Click
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ShowPageProperties()
End Sub
Private Sub MenuStripToolsInternetProperties_Click(sender As Object, e As EventArgs) Handles MenuStripToolsInternetProperties.Click
Process.Start("inetcpl.cpl")
End Sub
Private Sub MenuStripToolsInternetProxy_Click(sender As Object, e As EventArgs) Handles MenuStripToolsInternetProxy.Click
Process.Start("inetcpl.cpl", ",4")
End Sub
Private Sub MenuStripToolsNetworkDiagnostics_Click(sender As Object, e As EventArgs) Handles MenuStripToolsNetworkDiagnostics.Click
Process.Start("rundll32.exe", "ndfapi,NdfRunDllDiagnoseIncident")
End Sub
'About
Private Sub MenuStripHelpAbout_Click(sender As Object, e As EventArgs) Handles MenuStripHelpAbout.Click
Dim AboutForm As New Form()
AboutForm.Width = 450
AboutForm.Height = 350
AboutForm.StartPosition = FormStartPosition.CenterParent
AboutForm.Icon = CType(resources.GetObject("SourceCodeIcon"), System.Drawing.Icon)
AboutForm.ShowIcon = True
AboutForm.ShowInTaskbar = True
AboutForm.Text = "About BasicBrowser"
Dim lblAboutText As New Label()
'lblAboutText.Font =
lblAboutText.TextAlign = ContentAlignment.MiddleCenter
AboutForm.Controls.Add(lblAboutText)
lblAboutText.Dock = DockStyle.Fill
lblAboutText.Text = _
"Made by ░▒▓█│【Walkman】│█▓▒░ (Walkman100)" & vbNewLine & vbNewLine & _
"Source code available at: https://github.com/Walkman100/BasicBrowser" & vbNewLine & vbNewLine & _
"Go to https://github.com/Walkman100/BasicBrowser/issues/new to report bugs or suggest features" & vbNewLine & vbNewLine & _
"Hold ALT to reorganise all the buttons/menus at the top" & vbNewLine & vbNewLine & _
"Current Version: " & My.Application.Info.Version.ToString
AboutForm.Show()
End Sub
' ToolStrip options
Private Sub ToolStripBack_ButtonClick(sender As Object, e As EventArgs) Handles ToolStripBack.ButtonClick
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).GoBack()
ToolStripStop.Enabled = True
PerformStuff()
End Sub
Private Sub ToolStripBack_DropDownOpening(sender As Object, e As EventArgs) Handles ToolStripBack.DropDownOpening
ToolStripBack.DropDownItems.Clear()
For i = 1 To CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).History.Count
ToolStripBack.DropDownItems.Add(CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).History.Item(i - 1).ToString)
Next
End Sub
Private Sub ToolStripForward_ButtonClick(sender As Object, e As EventArgs) Handles ToolStripForward.ButtonClick
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).GoForward()
ToolStripStop.Enabled = True
PerformStuff()
End Sub
Private Sub ToolStripForward_DropDownOpening(sender As Object, e As EventArgs) Handles ToolStripForward.DropDownOpening
ToolStripForward.DropDownItems.Clear()
For i = 1 To CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).History.Count
ToolStripBack.DropDownItems.Add(CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).History.Item(i - 1).ToString)
Next
End Sub
Private Sub ToolStripReload_Click(sender As Object, e As EventArgs) Handles ToolStripReload.Click
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Reload()
ToolStripStop.Enabled = True
PerformStuff()
End Sub
Private Sub ToolStripStop_Click(sender As Object, e As EventArgs) Handles ToolStripStop.Click
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Stop()
ToolStripStop.Enabled = False
PerformStuff()
End Sub
Private Sub ToolStripHome_Click(sender As Object, e As EventArgs) Handles ToolStripHome.Click
'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).GoHome()
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Navigate("https://google.com")
ToolStripStop.Enabled = True
PerformStuff()
End Sub
Private Sub ToolStripURL_KeyDown(sender As Object, e As KeyEventArgs) Handles ToolStripURL.KeyDown
If e.KeyCode = Keys.Enter Then
ToolStripGo_Click(Nothing, Nothing)
End If
End Sub
Private Sub ToolStripURL_Focused(sender As Object, e As EventArgs) Handles ToolStripURL.GotFocus
ToolStripURL.SelectAll()
End Sub
Private Sub ToolStripGo_Click(sender As Object, e As EventArgs) Handles ToolStripGo.Click
If ToolStripURL.Text <> "" Then
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Navigate(ToolStripURL.Text)
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Focus()
Else
ToolStripURL.Focus()
End If
End Sub
Private Sub TabControl_Click(sender As Object, e As EventArgs) Handles TabControl.Click, TabControl.KeyUp
ToolStripStop.Enabled = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).IsBusy
PerformStuff()
End Sub
Private Sub BasicBrowser_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged, MyBase.Resize
ToolStripURL.Size = New Size(Me.Width - 243, 25)
End Sub
'Favourites bar (Integrated into URL bar)
Private Sub ToolStripAdd_Click(sender As Object, e As EventArgs) Handles ToolStripAdd.Click
ToolStripURL.Items.Add(CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Url.ToString)
My.Settings.Favourites.Add(CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Url.ToString)
My.Settings.Save()
End Sub
Private Sub ToolStripRemove_Click(sender As Object, e As EventArgs) Handles ToolStripRemove.Click
ToolStripURL.Items.RemoveAt(ToolStripURL.SelectedIndex)
My.Settings.Favourites.Remove(ToolStripURL.SelectedItem)
My.Settings.Save()
End Sub
Private Sub ToolStripURL_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ToolStripURL.SelectedIndexChanged
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Navigate(ToolStripURL.Items.Item(ToolStripURL.SelectedIndex).ToString)
CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Focus()
ToolStripURL.Invalidate()
End Sub
' browser stuff
Sub Navigate()
ToolStripStop.Enabled = True
PerformStuff()
End Sub
Sub DocumentCompleted()
ToolStripStop.Enabled = False
PerformStuff()
End Sub
Sub ProgressChanged(ByVal sender As Object, ByVal e As Skybound.Gecko.GeckoProgressEventArgs)
StatusStripProgressBar.Value = (e.CurrentProgress / e.MaximumProgress) * 100
If ToolStripURL.Focused = False Then
ToolStripURL.Text = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Url.ToString
End If
End Sub
Sub StatusTextChanged()
StatusStripStatusText.Text = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).StatusText
End Sub
Sub DocumentTitleChanged()
If CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).DocumentTitle <> "" Then
Me.Text = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).DocumentTitle & " - BasicBrowser"
End If
For i = 1 To TabControl.TabCount
TabControl.TabPages.Item(i - 1).Text = CType(TabControl.TabPages.Item(i - 1).Controls.Item(0), GeckoWebBrowser).DocumentTitle
Next
End Sub
Sub PerformStuff()
ToolStripBack.Enabled = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).CanGoBack
ToolStripForward.Enabled = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).CanGoForward
If ToolStripURL.Focused = False Then
ToolStripURL.Text = CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).Url.ToString
End If
End Sub
'Sub WebBrowserMouseClick(sender As Object, e As MouseEventArgs) Handles GeckoWebBrowser1.MouseClick, GeckoWebBrowser1.MouseUp, GeckoWebBrowser1.MouseDown
' MsgBox(e.Button.ToString)
' If e.Button = Windows.Forms.MouseButtons.Middle Then
' CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).CopyLinkLocation()
' openWithURI = Clipboard.GetText
' NewTab(Nothing, Nothing)
' 'ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
' ' CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ContextMenu.MenuItems.Add(LinkNT)
' End If
'End Sub
'Sub WebBrowserShowContextMenu(sender As Object, e As GeckoContextMenuEventArgs) Handles GeckoWebBrowser1.ShowContextMenu
' CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ContextMenu.Show(WBContextMenu, MousePosition)
' 'CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ContextMenu.MergeMenu(WBContextMenu)
' CType(TabControl.SelectedTab.Controls.Item(0), GeckoWebBrowser).ContextMenuStrip = WBContextMenu
'End Sub
End Class