VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 309,246 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,619 people online right now. Registration is fast and FREE... Join Now!




Webbrowser and Window.Open in JavaScript

 

Webbrowser and Window.Open in JavaScript, How to stop it?

Jack Eagles1

2 Jul, 2009 - 06:38 AM
Post #1

D.I.C Regular
***

Joined: 10 Dec, 2008
Posts: 252



Thanked: 6 times
My Contributions
Hi, I want to disable the Window.Open in Java on my webbrowser. However this is harder than it seems because I also want to get the URL which the script is attempting to open so if we had

Window.Open('http://www.google.com') then
The webbrowser would produce a dialog saying The current website wants to open a popup to http://www.google.com.

Here is my code so far:
CODE

    Private Sub me_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.NewWindow
        If pops <= 3 Then
            pops = pops + 1
            Dim a As Windows.Forms.DialogResult = MessageBox.Show(Me.Url.Host & "wants to open a popup window.", "Confirm", MessageBoxButtons.YesNo)
            If a = Windows.Forms.DialogResult.Yes Then
                Form1.mknewtab()
   Else
                MsgBox("Popup Blocked")
            End If
            e.Cancel = True
            MsgBox(e.ToString)
        End If
    End Sub



MkNewTab just makes a new tab, but I do not know how to get the url which the webpage wants to open.


User is offlineProfile CardPM
+Quote Post


Posts in this topic

Fast ReplyReply to this topicStart new topic

Time is now: 11/26/09 09:43AM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month