<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: объект Internet Explorer, работа с фреймом]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5642&amp;type=atom" />
	<updated>2011-03-24T21:00:06Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=5642</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: объект Internet Explorer, работа с фреймом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46800#p46800" />
			<content type="html"><![CDATA[<p>OFF: Не трещит, а щёлкает ! ) Это новая фича (feature) ослика. Таким образом майкрософт создаёт эффект сложности механизмов работающих внутри IE. (Работает как часы).</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2011-03-24T21:00:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46800#p46800</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: объект Internet Explorer, работа с фреймом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46796#p46796" />
			<content type="html"><![CDATA[<p>Спасибо! допер! Я вопрос немножко неправильно поставил. И еще вопросик: че он как трактор трещит?<br /></p><div class="codebox"><pre><code>Set IE = WScript.CreateObject(&quot;InternetExplorer.Application&quot;, &quot;IE_&quot;)
IE.Navigate &quot;http://mickey666x.narod.ru/other/frame.html&quot;
IE.Visible = True

Do
    WScript.Sleep 200
Loop Until IE.ReadyState = 4

While 0=0
    WScript.Sleep 1000
Wend

Sub IE_BeforeNavigate2(ByVal pDisp, ByRef url, ByRef Flags, ByRef TargetFrameName, ByRef PostData, ByRef Headers, ByRef Cancel)
    
    If InStr(URL, &quot;mickey666x&quot;) &gt; 0 Then
        Exit Sub
    Else
        pDisp.Navigate &quot;about:blank&quot;
        Cancel = True
    End If
End Sub

Sub IE_OnQuit()
    MsgBox &quot;Вы закрыли Internet Explorer&quot;,vbInformation,&quot;Internet Explorer&quot;
    WScript.Quit
End Sub</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Mickey666x]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26846</uri>
			</author>
			<updated>2011-03-24T20:39:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46796#p46796</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: объект Internet Explorer, работа с фреймом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46791#p46791" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Dim InternetExplorer, ExitDo
Set InternetExplorer = WScript.CreateObject(&quot;InternetExplorer.Application&quot;,&quot;InternetExplorer_&quot;)
InternetExplorer.Visible = True

InternetExplorer.Navigate &quot;http://www.ya.ru/&quot;

WScript.Sleep 5000

InternetExplorer.Navigate &quot;http://www.demogorgon.ru/&quot;

Sub InternetExplorer_OnQuit()
    ExitDo = True
End Sub

Sub InternetExplorer_BeforeNavigate2(ByVal pDisp, URL, Flags, TargetFrameName, PostData, Headers, Cancel)
    if InStr(1,URL,&quot;demogorgon&quot;,1) &gt; 0 then 
        InternetExplorer.Navigate &quot;about:blank&quot;
    End if    
End Sub

Do
    WScript.Sleep 100
Loop Until ExitDo

MsgBox &quot;Internet Explorer closed&quot;, vbInformation</code></pre></div><p>либо для фреймов</p><div class="codebox"><pre><code>InternetExplorer.Navigate &quot;about:blank&quot;</code></pre></div><p>заменить на<br /></p><div class="codebox"><pre><code>pDisp.Navigate &quot;about:blank&quot;</code></pre></div><p>P.S Вообще по идее нужно присваивать <strong>Cancel = True</strong>. Но что то не хочет он работать. И метод <strong>Stop</strong> тоже не спасает</p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2011-03-24T18:38:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46791#p46791</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: объект Internet Explorer, работа с фреймом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46788#p46788" />
			<content type="html"><![CDATA[<p>Я знаю что секрет кроется в событии BeforeNavigate2. Только как остановить загрузку фрейма вообще.<br /></p><div class="codebox"><pre><code>Sub IE_BeforeNavigate2(ByVal pDisp, ByRef url, ByRef Flags, ByRef TargetFrameName, ByRef PostData, ByRef Headers, ByRef Cancel)
    If InStr(URL, &quot;demogorgon&quot;) &gt; 0 Then
        Exit Sub
    Else
        pDisp.Stop
    End If
End Sub</code></pre></div><p>Вот что то вроде того, но навигация продолжается.</p>]]></content>
			<author>
				<name><![CDATA[Mickey666x]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26846</uri>
			</author>
			<updated>2011-03-24T17:47:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46788#p46788</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: объект Internet Explorer, работа с фреймом]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=46787#p46787" />
			<content type="html"><![CDATA[<p>Дан фрейм. В него загружается страница. Потом страница покидает фрейм. Я знаю что есть защита от помещения страницы в фрейм. Можно с этим бороться? Или как вообще отменить навигацию, когда он попытается покинуть фрейм.<br />Как есть:<br /></p><div class="codebox"><pre><code>Set IE=CreateObject(&quot;InternetExplorer.Application&quot;)
IE.Visible=True
IE.Navigate &quot;http://www.demogorgon.ru/&quot;
WScript.Sleep 10000
IE.Navigate &quot;http://www.sumaclicks.com&quot;, Null, &quot;mainFrame&quot;</code></pre></div><p>А вот пример как надо:<br /></p><div class="codebox"><pre><code>Set IE=CreateObject(&quot;InternetExplorer.Application&quot;)
IE.Visible=True
IE.Navigate &quot;http://www.demogorgon.ru/&quot;
WScript.Sleep 10000
IE.Navigate &quot;ya.ru&quot;, Null, &quot;mainFrame&quot;</code></pre></div><p>Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Mickey666x]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26846</uri>
			</author>
			<updated>2011-03-24T17:29:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=46787#p46787</id>
		</entry>
</feed>
