Skip to content

Commit

Permalink
Popups can now be allowed in Internet Explorer by holding Ctrl+Alt wh…
Browse files Browse the repository at this point in the history
…en clicking a link.
  • Loading branch information
Riley McArdle committed Feb 1, 2010
1 parent 6afe0c9 commit d44254f
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 23 deletions.
9 changes: 9 additions & 0 deletions CREDITS.TXT
Expand Up @@ -6,6 +6,15 @@ Riley McArdle
David Vidmar


Included Source Code
====================

Command Line Arguments Parser 1.0
Copyright � 2002 Richard Lopes
MIT License
http://www.codeproject.com/KB/recipes/command_line.aspx


Included Components
===================

Expand Down
2 changes: 1 addition & 1 deletion mRemoteV1/App/App.Runtime.vb
Expand Up @@ -1530,7 +1530,7 @@ Namespace App
Public Shared Sub GoToURL(ByVal URL As String)
Dim cI As New mRemote.Connection.Info

cI.Name = "Website"
cI.Name = ""
cI.Hostname = URL
If URL.StartsWith("https:") Then
cI.Protocol = Connection.Protocol.Protocols.HTTPS
Expand Down
1 change: 1 addition & 0 deletions mRemoteV1/CHANGELOG.TXT
Expand Up @@ -10,6 +10,7 @@
Improved RDP error reporting
Added support for Credential Security Support Provider (CredSSP) which is required for Network Level Authentication (NLA)
Added support for connecting through Remote Desktop Gateway servers
Popups can now be allowed in Internet Explorer by holding Ctrl+Alt when clicking a link

1.62:
Switched to VncSharp, an open source VNC component
Expand Down
70 changes: 49 additions & 21 deletions mRemoteV1/Connection/Connection.Protocol.HTTPBase.vb
@@ -1,6 +1,5 @@
Imports System.Windows.Forms
Imports mRemote.App.Runtime
Imports Skybound.Gecko
Imports System.ComponentModel

Namespace Connection
Expand All @@ -19,7 +18,6 @@ Namespace Connection
Public Sub New(ByVal RenderingEngine As RenderingEngine)
Try
If RenderingEngine = RenderingEngine.Gecko Then
'Skybound.Gecko.Xpcom.Initialize(My.Settings.XULRunnerPath)
Me.Control = New MiniGeckoBrowser.MiniGeckoBrowser
TryCast(Me.Control, MiniGeckoBrowser.MiniGeckoBrowser).XULrunnerPath = My.Settings.XULRunnerPath
Else
Expand All @@ -39,19 +37,29 @@ Namespace Connection
MyBase.SetProps()

Try
wBrowser = Me.Control
Dim objTabPage As Crownwood.Magic.Controls.TabPage = TryCast(Me.InterfaceControl.Parent, Crownwood.Magic.Controls.TabPage)
Me.tabTitle = objTabPage.Title
Catch ex As Exception
Me.tabTitle = ""
End Try

Try
Me.wBrowser = Me.Control

If InterfaceControl.Info.RenderingEngine = RenderingEngine.Gecko Then
'AddHandler TryCast(wBrowser, GeckoWebBrowser).CreateWindow, AddressOf gex_CreateWindow
AddHandler TryCast(wBrowser, MiniGeckoBrowser.MiniGeckoBrowser).TitleChanged, AddressOf wBrowser_DocumentTitleChanged
AddHandler TryCast(wBrowser, MiniGeckoBrowser.MiniGeckoBrowser).LastTabRemoved, AddressOf wBrowser_LastTabRemoved
'wBrowser.Width = wBrowser.Width
Dim objMiniGeckoBrowser As MiniGeckoBrowser.MiniGeckoBrowser = TryCast(wBrowser, MiniGeckoBrowser.MiniGeckoBrowser)

AddHandler objMiniGeckoBrowser.TitleChanged, AddressOf wBrowser_DocumentTitleChanged
AddHandler objMiniGeckoBrowser.LastTabRemoved, AddressOf wBrowser_LastTabRemoved
Else
TryCast(wBrowser, WebBrowser).AllowWebBrowserDrop = False
TryCast(wBrowser, WebBrowser).ScrollBarsEnabled = True
Dim objWebBrowser As WebBrowser = TryCast(wBrowser, WebBrowser)
Dim objAxWebBrowser As SHDocVw.WebBrowser = DirectCast(objWebBrowser.ActiveXInstance, SHDocVw.WebBrowser)

objWebBrowser.AllowWebBrowserDrop = False
objWebBrowser.ScrollBarsEnabled = True

AddHandler TryCast(wBrowser, WebBrowser).DocumentTitleChanged, AddressOf wBrowser_DocumentTitleChanged
AddHandler TryCast(wBrowser, WebBrowser).NewWindow, AddressOf wBrowser_NewWindow
AddHandler objWebBrowser.DocumentTitleChanged, AddressOf wBrowser_DocumentTitleChanged
AddHandler objAxWebBrowser.NewWindow3, AddressOf wBrowser_NewWindow3
End If

Return True
Expand Down Expand Up @@ -111,14 +119,15 @@ Namespace Connection

#Region "Events"
Private Sub gex_CreateWindow(ByVal sender As Object, ByVal e As Skybound.Gecko.GeckoCreateWindowEventArgs)
'Dim tP As TabPage = AddTab()
'e.WebBrowser = tP.Controls(0)
e.WebBrowser = Me.wBrowser
End Sub

Private Sub wBrowser_NewWindow(ByVal sender As Object, ByVal e As CancelEventArgs)
e.Cancel = True
TryCast(wBrowser, WebBrowser).Navigate(TryCast(wBrowser, WebBrowser).StatusText)
Private Sub wBrowser_NewWindow3(ByRef ppDisp As Object, ByRef Cancel As Boolean, ByVal dwFlags As Long, ByVal bstrUrlContext As String, ByVal bstrUrl As String)
If (dwFlags And NWMF.NWMF_OVERRIDEKEY) Then
Cancel = False
Else
Cancel = True
End If
End Sub

Private Sub wBrowser_LastTabRemoved(ByVal sender As Object)
Expand All @@ -131,10 +140,6 @@ Namespace Connection
tabP = TryCast(InterfaceControl.Parent, Crownwood.Magic.Controls.TabPage)

If tabP IsNot Nothing Then
If tabTitle = "" Then
tabTitle = tabP.Title
End If

Dim shortTitle As String = ""

If Me.InterfaceControl.Info.RenderingEngine = RenderingEngine.Gecko Then
Expand All @@ -151,20 +156,43 @@ Namespace Connection
End If
End If

tabP.Title = tabTitle & " - " & shortTitle
If Me.tabTitle <> "" Then
tabP.Title = tabTitle & " - " & shortTitle
Else
tabP.Title = shortTitle
End If
End If
Catch ex As Exception
mC.AddMessage(Messages.MessageClass.WarningMsg, "wBrowser_DocumentTitleChanged (Connection.Protocol.HTTPBase) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
#End Region

#Region "Enums"
Public Enum RenderingEngine
<Description("Internet Explorer")> _
IE = 1
<Description("Gecko (Firefox)")> _
Gecko = 2
End Enum

Private Enum NWMF
NWMF_UNLOADING = &H1
NWMF_USERINITED = &H2
NWMF_FIRST = &H4
NWMF_OVERRIDEKEY = &H8
NWMF_SHOWHELP = &H10
NWMF_HTMLDIALOG = &H20
NWMF_FROMDIALOGCHILD = &H40
NWMF_USERREQUESTED = &H80
NWMF_USERALLOWED = &H100
NWMF_FORCEWINDOW = &H10000
NWMF_FORCETAB = &H20000
NWMF_SUGGESTWINDOW = &H40000
NWMF_SUGGESTTAB = &H80000
NWMF_INACTIVETAB = &H100000
End Enum
#End Region
End Class
End Namespace
End Namespace
13 changes: 12 additions & 1 deletion mRemoteV1/mRemoteV1.vbproj
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4934A491-40BC-4E5B-9166-EA1169A220F6}</ProjectGuid>
<OutputType>WinExe</OutputType>
Expand Down Expand Up @@ -361,6 +361,7 @@
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.Announcment.resx">
<DependentUpon>UI.Window.Announcment.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.ComponentsCheck.resx">
<DependentUpon>UI.Window.ComponentsCheck.vb</DependentUpon>
Expand Down Expand Up @@ -809,6 +810,16 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<COMReference Include="SHDocVw">
<Guid>{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>1</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit d44254f

Please sign in to comment.