<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: HTMLFile, переадресация]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15176&amp;type=atom" />
	<updated>2020-02-10T13:15:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15176</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137778#p137778" />
			<content type="html"><![CDATA[<p>Хотя нет, так сработало вроде:<br /></p><div class="codebox"><pre><code>#Persistent
html =
(
&lt;!DOCTYPE html&gt;
&lt;head&gt;
   &lt;meta charset=&quot;UTF-8&quot;&gt;
   &lt;title&gt;Document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   &lt;script&gt;
      function timer() {
         alert(&#039;Сработал таймер&#039;);
      }
      setTimeout(timer, 1000);
   &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
)

doc := ComObjCreate(&quot;htmlfile&quot;)
doc.write(&quot;&lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=9&quot;&quot;&gt;&quot;)
doc.designMode := &quot;on&quot;
; doc.parentWindow.setTimeout := &quot;&quot;
doc.write(html)
MsgBox, % doc.querySelector(&quot;body&quot;).innerHTML</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T13:15:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137778#p137778</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137777#p137777" />
			<content type="html"><![CDATA[<p>Так парсинг перестаёт работать:<br /></p><div class="codebox"><pre><code>#Persistent
html =
(
&lt;!DOCTYPE html&gt;
&lt;head&gt;
   &lt;meta charset=&quot;UTF-8&quot;&gt;
   &lt;title&gt;Document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   &lt;script&gt;
      function timer() {
         alert(&#039;Сработал таймер&#039;);
      }
      setTimeout(timer, 1000);
   &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
)

doc := ComObjCreate(&quot;htmlfile&quot;)
doc.designMode := &quot;on&quot;
doc.write(&quot;&lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=9&quot;&quot;&gt;&quot;)
; doc.parentWindow.setTimeout := &quot;&quot;
doc.write(html)
MsgBox, % doc.querySelector(&quot;body&quot;).innerHTML</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T13:13:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137777#p137777</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137776#p137776" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>doc.designMode := &quot;on&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2020-02-10T13:06:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137776#p137776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137775#p137775" />
			<content type="html"><![CDATA[<p>Вопрос конечно, иначе я привёл бы код.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-02-10T12:45:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137775#p137775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137774#p137774" />
			<content type="html"><![CDATA[<p>Это вопрос или утверждение? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T12:43:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137774#p137774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137770#p137770" />
			<content type="html"><![CDATA[<p>Можно просто ноль.<br /></p><div class="codebox"><pre><code>doc.parentWindow.setTimeout := 0</code></pre></div><p>А возможно выключить JS в целом, наподобие:<br /></p><div class="codebox"><pre><code>JS.eval(&quot;delete ActiveXObject; delete GetObject;&quot;)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-02-10T09:59:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137770#p137770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137768#p137768" />
			<content type="html"><![CDATA[<p>В смысле? Одна строчка.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T05:05:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137768#p137768</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137767#p137767" />
			<content type="html"><![CDATA[<p>Что-то слишком. Тогда уж проще проверять переменную на наличие той же картинки 404 и не создавать Com объект.<br />Спасибо за ответы.</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2020-02-10T05:02:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137767#p137767</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137766#p137766" />
			<content type="html"><![CDATA[<p>Можно попробовать setTimeout переопределить:<br /></p><div class="codebox"><pre><code>#Persistent
html =
(
&lt;!DOCTYPE html&gt;
&lt;head&gt;
   &lt;meta charset=&quot;UTF-8&quot;&gt;
   &lt;title&gt;Document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
   &lt;script&gt;
      function timer() {
         alert(&#039;Сработал таймер&#039;);
      }
      setTimeout(timer, 1000);
   &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
)

doc := ComObjCreate(&quot;htmlfile&quot;)
doc.write(&quot;&lt;meta http-equiv=&quot;&quot;X-UA-Compatible&quot;&quot; content=&quot;&quot;IE=9&quot;&quot;&gt;&quot;)
; doc.parentWindow.setTimeout := Func(&quot;Dummy&quot;)
doc.write(html)

Dummy(params*) {
}</code></pre></div><p>Запустите, потом раскомментируйте строку, и снова запустите.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T04:00:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137766#p137766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137765#p137765" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
function error(){
location=&quot;/&quot;;
}
setTimeout( &#039;error()&#039;, 7000 );
&lt;/script&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2020-02-10T02:33:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137765#p137765</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137764#p137764" />
			<content type="html"><![CDATA[<p>Я с таким не сталкивался, нужен конкретный пример.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T02:03:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137764#p137764</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137763#p137763" />
			<content type="html"><![CDATA[<p>Я тоже думал об удалении, но может есть какие-то другие варианты?</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2020-02-10T01:17:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137763#p137763</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137762#p137762" />
			<content type="html"><![CDATA[<p>Парсить через RegEx? Ну, или перед парсингом удалить через RegEx джаваскрипты.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-02-10T01:04:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137762#p137762</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: HTMLFile, переадресация]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137760#p137760" />
			<content type="html"><![CDATA[<p>Доброго времени суток, есть вот такой код:<br /></p><div class="codebox"><pre><code>(document := ComObjCreate(&quot;HTMLFile&quot;)).write(var)</code></pre></div><p>Я это использую для парсинга страницы, и попадаются страницы, где есть переадресация через JS вроде и когда проходит таймер - вылазит окошко от windows:<br /><span class="postimg"><img src="http://s01.geekpic.net/di-SY6AUC.png" alt="http://s01.geekpic.net/di-SY6AUC.png" /></span><br />Подскажите, как можно этого избежать?</p>]]></content>
			<author>
				<name><![CDATA[Phoenixxx_Czar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34426</uri>
			</author>
			<updated>2020-02-10T00:37:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137760#p137760</id>
		</entry>
</feed>
