From f0239ea5f6329b06940275b4f72befe2ab817ca3 Mon Sep 17 00:00:00 2001 From: shanxing2 <2287190283@qq.com> Date: Thu, 24 Feb 2022 22:22:04 +0800 Subject: [PATCH] bug fix --- source/FrmWeb.vb | 18 ++++++++++++++++++ ...344\273\266\346\243\200\346\265\213.vbproj" | 10 +++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/source/FrmWeb.vb b/source/FrmWeb.vb index 6a0b24f..f6df35a 100644 --- a/source/FrmWeb.vb +++ b/source/FrmWeb.vb @@ -123,4 +123,22 @@ Public Class FrmWeb End If End If End Sub + + Private Sub Web1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles Web1.DocumentCompleted + If Web1.Document Is Nothing Then Return + + ' 将所有的链接的目标,指向本窗体 + For Each archor As HtmlElement In Web1.Document.Links + archor.SetAttribute("target", "_self") + Next + + ' 将所有的FORM的提交目标,指向本窗体 + For Each form As HtmlElement In Web1.Document.Forms + form.SetAttribute("target", "_self") + Next + End Sub + + Private Sub Web1_NewWindow(sender As Object, e As CancelEventArgs) Handles Web1.NewWindow + e.Cancel = True + End Sub End Class \ No newline at end of file diff --git "a/source/\350\277\235\350\247\204\347\275\221\347\233\230\346\226\207\344\273\266\346\243\200\346\265\213.vbproj" "b/source/\350\277\235\350\247\204\347\275\221\347\233\230\346\226\207\344\273\266\346\243\200\346\265\213.vbproj" index 06446a0..9e9f8bf 100644 --- "a/source/\350\277\235\350\247\204\347\275\221\347\233\230\346\226\207\344\273\266\346\243\200\346\265\213.vbproj" +++ "b/source/\350\277\235\350\247\204\347\275\221\347\233\230\346\226\207\344\273\266\346\243\200\346\265\213.vbproj" @@ -37,7 +37,7 @@ 1.0.0.1 true publish.htm - 6 + 7 1.0.0.%2a false true @@ -238,22 +238,22 @@ False + Exclude + True - Exclude - True Assembly False + Exclude + True - Exclude - True Assembly