<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Получение страницы через "InternetExplorer"]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9183&amp;type=atom" />
	<updated>2018-12-10T16:53:56Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9183</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130352#p130352" />
			<content type="html"><![CDATA[<p>Ага, мне так и казалось, что это фишка браузера.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-10T16:53:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130352#p130352</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130351#p130351" />
			<content type="html"><![CDATA[<p>А нет, всё-таки броузер посылает клик.<br /></p><div class="quotebox"><blockquote><p>If the user agent supports letting the user submit a form implicitly (for example, on some platforms hitting the &quot;enter&quot; key while a text control is focused implicitly submits the form), then doing so for a form, whose default button has activation behavior and is not disabled, must cause the user agent to fire a click event at that default button.</p></blockquote></div><p><a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission">https://html.spec.whatwg.org/multipage/ … submission</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-10T16:48:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130351#p130351</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130350#p130350" />
			<content type="html"><![CDATA[<p>Так «какие» события и «как» обрабатывается — это не одно и то же.<br />Осталось непонятным, каким образом посылается клик и зачем.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-10T16:28:22Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130350#p130350</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130349#p130349" />
			<content type="html"><![CDATA[<p>Я так понял, что ты имел в виду, что для того чтобы разобраться, как обрабатывается enter, нужно разбираться в коде этой js библиотеке.<br />Поэтому и написал, что не нужно, так как броузер покажет, какие события он обрабатывает.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Или ты имеешь в виду, что сам браузер мониторит события и посылает клик, когда мы нажимаем Enter в поле ввода?</p></blockquote></div><p>Сомневаюсь, что броузер сам посылает клик.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-10T16:22:15Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130349#p130349</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130348#p130348" />
			<content type="html"><![CDATA[<p>И о чём это говорит? Если функции-обработчика нет, как браузер узнает, что нужно делать при наступлении того или иного события?<br />Или ты имеешь в виду, что сам браузер мониторит события и посылает клик, когда мы нажимаем Enter в поле ввода?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-10T15:52:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130348#p130348</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130347#p130347" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>функция обработчика пока неизвестна</p></blockquote></div><p>Для мониторинга она ненужна.<br />Выбираем нужный нам элемент, потом в консоле ставим галочку на Preserve log и выполняем:<br /></p><div class="codebox"><pre><code>monitorEvents($0)</code></pre></div><p>В результате получаем, что вместе с энтером посылается клик:<br /></p><div class="codebox"><pre><code>keydown KeyboardEvent {isTrusted: true, key: &quot;Enter&quot;, code: &quot;Enter&quot;, location: 0, ctrlKey: false, …}
keypress KeyboardEvent {isTrusted: true, key: &quot;Enter&quot;, code: &quot;Enter&quot;, location: 0, ctrlKey: false, …}
click MouseEvent {isTrusted: true, screenX: 0, screenY: 0, clientX: 0, clientY: 0, …}
keyup KeyboardEvent {isTrusted: true, key: &quot;Enter&quot;, code: &quot;Enter&quot;, location: 0, ctrlKey: false, …}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-10T12:00:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130347#p130347</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130329#p130329" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А эта информация откуда?</p></blockquote></div><p>Очевидно, оттуда же, откуда у тебя информация о<br /></p><div class="quotebox"><blockquote><p>В Event Listeners keydown на эти элементы присутствует</p></blockquote></div><p>из Хрома, вкладка Event Listeners, описание события keydown.</p><div class="quotebox"><blockquote><p>отлавливаются события нажатия enter</p></blockquote></div><p>Ну значит они всё же обрабатываются, видимо через JsAction, но функция обработчика пока неизвестна, поэтому как именно обрабатываются — непонятно, может как-то определяются и блокируются нефизические события.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-09T19:17:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130329#p130329</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130328#p130328" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Действительно, в Хроме есть, но в них нет обработки Enter (key: 13).</p></blockquote></div><p>А эта информация откуда?<br />Давай про одну кнопку - &quot;Google Search&quot;.<br />Если вписать в поиск какой-то текст и поставить на эту кнопку в консоле мониторинг событий monitorEvents($0, &quot;key&quot;), то там отлавливаются события нажатия enter.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-09T18:50:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130328#p130328</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130327#p130327" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>В Event Listeners keydown на эти элементы присутствует</p></blockquote></div><p>Действительно, в Хроме есть, но в них нет обработки Enter (key: 13).<br />Фокус на кнопку «Мне повезёт» можно установить клавишей Tab, но если в поле ввода присутствует текст, Enter не срабатывает даже вручную.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-09T18:08:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130327#p130327</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130313#p130313" />
			<content type="html"><![CDATA[<p>А почему ты думаешь, что не может произойти?<br />В Event Listeners keydown на эти элементы присутствует.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-08T16:50:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130313#p130313</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130312#p130312" />
			<content type="html"><![CDATA[<p>Для dispatchEvent не играет, но зачем подписывать элемент на событие, которого не может произойти? Я до завтра без компьютера, сейчас не могу попробовать.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-08T15:35:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130312#p130312</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130303#p130303" />
			<content type="html"><![CDATA[<p>Я думаю, что фокус при выполнении dispatchEvent роли не играет.<br />По второму коду есть какие-то предположения?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-08T10:59:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130303#p130303</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130300#p130300" />
			<content type="html"><![CDATA[<p>Это как раз странно, что отправка клавиши кнопке хоть как-то срабатывает. Ведь клавиатурные нажатия по идее посылаются элементу, на котором фокус, а кнопка здесь не может быть в фокусе.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-08T10:45:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130300#p130300</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130298#p130298" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А почему ты думаешь, что эта кнопка вообще должна на это событие реагировать?</p></blockquote></div><p>Потому что такой код срабатывает:<br /></p><div class="codebox"><pre><code>oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
oIE.Visible := True
oIE.Navigate(&quot;https://google.com&quot;)
While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
   Sleep, 10
input := oIE.document.querySelector(&quot;input[name=&quot;&quot;btnI&quot;&quot;]&quot;)
event := oIE.document.createEvent(&quot;KeyboardEvent&quot;)
event.initKeyboardEvent(&quot;keydown&quot;, true, true, oIE.document.defaultView, &quot;Enter&quot;, 0, &quot;&quot;, false, &quot;en-US&quot;)
input.dispatchEvent(event)</code></pre></div><p>Могу предположить, что срабатывание блокируется (preventDefault) при вводе текста в поисковое поле.<br />Но кнопка поиска вообще не работает.<br />Хотя если вручную нажать энтер, то срабатывает.<br /></p><div class="codebox"><pre><code>oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
oIE.Visible := True
oIE.Navigate(&quot;https://google.com&quot;)
While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
   Sleep, 10
input := oIE.document.querySelector(&quot;input[name=&quot;&quot;q&quot;&quot;]&quot;)
input.value := &quot;test&quot;
input := oIE.document.querySelectorAll(&quot;input[name=&quot;&quot;btnK&quot;&quot;]&quot;)[1]
input.focus()
event := oIE.document.createEvent(&quot;Event&quot;)
event.initEvent(&quot;keydown&quot;, true, true)
event.keyCode := 13 ; enter
msgbox % input.dispatchEvent(event)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-12-08T09:37:13Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130298#p130298</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение страницы через "InternetExplorer"]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=130296#p130296" />
			<content type="html"><![CDATA[<p>А почему ты думаешь, что эта кнопка вообще должна на это событие реагировать? Можно клик послать.</p><p><span class="postimg"><img src="https://i.imgur.com/biW7ggz.png" alt="https://i.imgur.com/biW7ggz.png" /></span></p><p>Там события обрабатываются через библиотеку <a href="http://prgssr.ru/development/patterny-dlya-obrabotki-sobytij-v-javascript.html#heading-jsaction">JsAction</a>, нужно с ней разбираться.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2018-12-08T00:53:40Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=130296#p130296</id>
		</entry>
</feed>
