<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Взаимодействие с DOM из activex]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=17003&amp;type=atom" />
	<updated>2022-02-27T17:57:40Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=17003</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152468#p152468" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>Это помогло, спасибо.</p>]]></content>
			<author>
				<name><![CDATA[sqrt(mom_weight)]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42386</uri>
			</author>
			<updated>2022-02-27T17:57:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152468#p152468</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152467#p152467" />
			<content type="html"><![CDATA[<p>Нужно в реестр прописать ключ для AHK, можно таким кодом:<br /></p><div class="codebox"><pre><code>FixIE()

FixIE() {
   static regKey := &quot;HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION&quot;
   SplitPath, % A_IsCompiled ? A_ScriptFullPath : A_AhkPath, exeName
   RegRead, value, % regKey, % exeName
   if (value != 11000)
      RegWrite, REG_DWORD, % regKey, % exeName, 11000
   Return !ErrorLevel
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-27T17:49:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152467#p152467</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152466#p152466" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><div class="codebox"><pre><code>
Неизвестное имя.
querySelector.
</code></pre></div><p>На саму строку и ругается.<br /></p><div class="codebox"><pre><code>
WB.document.querySelector(&quot;a[href=&quot;&quot;https://forum.script-coding.com/index.php&quot;&quot;]&quot;).addEventListener(&quot;mousedown&quot;, Func(&quot;OnButton&quot;))
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sqrt(mom_weight)]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42386</uri>
			</author>
			<updated>2022-02-27T17:45:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152466#p152466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152465#p152465" />
			<content type="html"><![CDATA[<p>Яндекс не причём, есть правила форума. Считаете, что за одну не стоит предъявлять, так может и за две не стоит? Да ладно, и три не так много. В общем, надеюсь, поняли.<br /></p><div class="quotebox"><cite>sqrt(mom_weight) пишет:</cite><blockquote><p>Подобного рода конструкции не работают</p></blockquote></div><p>Вроде всё работает:<br /></p><div class="codebox"><pre><code>Gui, Add, ActiveX, w500 h500 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.Navigate(&quot;https://forum.script-coding.com/&quot;)
while WB.busy || WB.ReadyState != 4
   Sleep, 100
Gui, Show

WB.document.querySelector(&quot;a[href=&quot;&quot;https://forum.script-coding.com/index.php&quot;&quot;]&quot;).addEventListener(&quot;mousedown&quot;, Func(&quot;OnButton&quot;))

OnButton() {
   MsgBox, test
}</code></pre></div><p>Кликайте по заголовку Серый форум.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-27T17:41:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152465#p152465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152463#p152463" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>За одну точку предъявить это сильно.<br />Яндекс лучше ранжировать не станет.</p>]]></content>
			<author>
				<name><![CDATA[sqrt(mom_weight)]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42386</uri>
			</author>
			<updated>2022-02-27T17:37:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152463#p152463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152462#p152462" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sqrt(mom_weight) пишет:</cite><blockquote><p>Поэтому и пишу сюда, потому что не знаю почему)</p></blockquote></div><p>А что с точками опять?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-27T17:35:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152462#p152462</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152459#p152459" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>Поэтому и пишу сюда, потому что не знаю почему.<br /></p><div class="codebox"><pre><code>
WB.document.querySelector(&quot;button&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnButton&quot;))
OnButton()
{
	msgbox test
}
</code></pre></div><p>Подобного рода конструкции не работают при использовании.<br /></p><div class="codebox"><pre><code>
WB.Navigate(&quot;http://site.com/&quot;)
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sqrt(mom_weight)]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42386</uri>
			</author>
			<updated>2022-02-27T17:03:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152459#p152459</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152455#p152455" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>sqrt(mom_weight) пишет:</cite><blockquote><p>Все работает, куки читаются и сохраняются. Но в таком варианте я не могу взаимодействовать с DOM никак</p></blockquote></div><p><strong>sqrt(mom_weight)</strong>, добро пожаловать на форум! Ознакомьтесь, пожалуйста, с <a href="https://forum.script-coding.com/misc.php?action=rules">Правилами</a>, отредактируйте свой пост. Обратите внимание на <a href="https://forum.script-coding.com/misc.php?action=rules#literacy">точки</a> в конце предложений.<br />Непонятно, почему именно не можете, в вашем коде нет ничего, что бы этому мешало.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2022-02-27T08:19:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152455#p152455</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Взаимодействие с DOM из activex]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=152452#p152452" />
			<content type="html"><![CDATA[<p>Доброе утро.</p><p>Я использую следующий код, чтобы вывести нужную страничку в activex.</p><div class="codebox"><pre><code>
Gui, Add, ActiveX, w500 h500 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.Navigate(&quot;http://site.com/&quot;)
Gui, Show
Return
</code></pre></div><p>Все работает, куки читаются и сохраняются. Но в таком варианте я не могу взаимодействовать с DOM никак.</p><p>В таком варианте возможно взаимодействие, но не передаются куки.</p><div class="codebox"><pre><code>
html =
(
&lt;!DOCTYPE html&gt;
&lt;html&gt;
   &lt;head&gt;
      &lt;style&gt;
			body {background:grey;}
      &lt;/style&gt;
	&lt;/head&gt;
   &lt;body&gt;
		&lt;button&gt;test&lt;/button&gt;
   &lt;/body&gt;
&lt;/html&gt;
)
Gui, Add, ActiveX, w500 h500 vWB, about:&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; 
WB.document.write(html)
WB.document.querySelector(&quot;button&quot;).addEventListener(&quot;mouseup&quot;, Func(&quot;OnButton&quot;))
Gui, Show
Return
OnButton()
{
	msgbox test
}
</code></pre></div><p>Собственно, возможно ли повесить функции на элементы в DOM как во втором варианте, только для первого?<br />И так же при первом варианте, в папку с кэшем IE скачиваются все файлы со странички (картинки, стили и сама страница). По закрытию окна, файл html удаляется, а картинки и стили нет, возможно ли как-то очищать их автоматом как с html файлом?<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[sqrt(mom_weight)]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=42386</uri>
			</author>
			<updated>2022-02-27T04:37:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=152452#p152452</id>
		</entry>
</feed>
