0 Replies - 1576 Views - Last Post: 02 July 2009 - 07:38 AM Rate Topic: -----

#1 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 187
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Webbrowser and Window.Open in JavaScript

Post icon  Posted 02 July 2009 - 07:38 AM

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:
	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
				MsgBox("Popup Blocked")
			End If
			e.Cancel = True
		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.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1