<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Включение/выключение javascript в ie]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10689</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10689&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Включение/выключение javascript в ie».]]></description>
		<lastBuildDate>Sun, 14 Jun 2015 00:36:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94485#p94485</link>
			<description><![CDATA[<p>Пока только придумал, проверять включенную джаву через яндекс: <br /></p><div class="codebox"><pre><code>CloseProcess(&quot;iexplore.exe&quot;)
loop 20
{
   if A_Index = 1
      enableJava()
   if A_Index = 2
   {
      disableJava()
      disableJava := 1
   }
   loop
   {
      com++
      oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
      oIE.navigate(&quot;http://yandex.ru/internet&quot;)
      While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
         Sleep, 10
      if disableJava != 1
         break
      ResponseText := oIE.document.documentElement.OuterHtml
      If Instr(ResponseText, &quot;&lt;strong&gt;JavaScript&lt;/strong&gt;: да&quot;)
      {
         oIE.visible := True, oIEHWND := oIE.HWND
         WinMaximize ahk_id %oIEHWND%
         msgbox, экземпляр IE %com% почему-то использует джаву
         Continue
      }
      msgbox, с экземпляром IE %com% все в порядке
      break
   }
}

CloseProcess(MyProc)
{
   ErrorLevel := 1
   While ErrorLevel and A_Index &lt; 10
   {
      Process, Close, %MyProc%
      Process, WaitClose, %MyProc%, 1
   }
   return
}

enableJava()
{
   regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 0
   dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
   return
}

disableJava()
{
   regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 3
   dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
   return
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sun, 14 Jun 2015 00:36:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94485#p94485</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94481#p94481</link>
			<description><![CDATA[<p>Хорошо, но если изменить эту настройку в самом броузере, то рестарт приложения не нужен.<br />Но ладно.<br />Вот написал скрипт и хоть убей не могу логичесуи объяснить почему при второй и шестой итерации этот джаваскрит становится вновь запущенным???<br />Если откоментить 2 строчки с закрытием IE окна либо откоментить<br /></p><div class="codebox"><pre><code>   ;If (A_Index = 2) or (A_Index = 6)
   ;   Continue</code></pre></div><p>то все становится в порядке.<br />Но мне надо чтобы все окна запускались с отключенным джаваскриптом.<br /></p><div class="codebox"><pre><code>CloseProcess(&quot;iexplore.exe&quot;)
ComObjError(false)
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 0
dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
oIE.visible := True, oIEHWND := oIE.HWND
WinMaximize ahk_id %oIEHWND%
oIE.navigate(&quot;https://www.whatismybrowser.com/is-javascript-enabled&quot;)
While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
   Sleep, 10
If Instr(oIE.document.documentElement.OuterHtml, &quot;&lt;span&gt;No&lt;/span&gt;&quot;)
   msgbox % Error

regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 3
dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
loop 10
{
   oIE := ComObjCreate(&quot;InternetExplorer.Application&quot;)
   ;If (A_Index = 2) or (A_Index = 6)
   ;   Continue
   oIE.visible := True, oIEHWND := oIE.HWND
   WinMaximize ahk_id %oIEHWND%
   oIE.navigate(&quot;https://www.whatismybrowser.com/is-javascript-enabled&quot;)
   While oIE.readyState != 4 || oIE.document.readyState != &quot;complete&quot; || oIE.busy
      Sleep, 10
   If Instr(oIE.document.documentElement.OuterHtml, &quot;&lt;span&gt;Yes&lt;/span&gt;&quot;)
      msgbox % &quot;Ошибка на &quot; A_Index &quot; итерации &quot;
   ;WinClose ahk_id %oIEHWND%
   ;WinWaitClose ahk_id %oIEHWND%
}

CloseProcess(MyProc)
{
   ErrorLevel := 1
   While ErrorLevel and A_Index &lt; 10
   {
      Process, Close, %MyProc%
      Process, WaitClose, %MyProc%, 1
   }
   return
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 13 Jun 2015 18:11:55 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94481#p94481</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94473#p94473</link>
			<description><![CDATA[<p>Ну, некоторые настройки изменяются вообще только после перезагрузки системы, так что не факт, что это возможно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 13 Jun 2015 15:28:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94473#p94473</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94471#p94471</link>
			<description><![CDATA[<p>Да. Уверен. Я этот ключ сам искал в<br /><a href="https://support.microsoft.com/en-us/kb/182569">https://support.microsoft.com/en-us/kb/182569</a><br />И он действительно изменяет значение в Internet Security settings -&gt; enable/disable scripting.<br />Но запущенная версия IE не подхватывает эти изменения.<br />Для этого вызываем wininet.dll<br /><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa385328%28v=vs.85%29.aspx">https://msdn.microsoft.com/en-us/librar … 85%29.aspx</a><br /></p><div class="codebox"><pre><code>INTERNET_OPTION_SETTINGS_CHANGED
    39
    Notifies the system that the registry settings have been changed so that it verifies the settings on the next call to InternetConnect. This is used by InternetSetOption.</code></pre></div><p>Но почему-то эта фишка не срабатывает с запущенными приложениями Ie.<br />Для изменения прокси на лету после 39, нужно еще вызывать 37<br /></p><div class="quotebox"><blockquote><p>INTERNET_OPTION_REFRESH<br />&nbsp; &nbsp; 37<br />&nbsp; &nbsp; Causes the proxy data to be reread from the registry for a handle. No buffer is required. This option can be used on the HINTERNET handle returned by InternetOpen. It is used by InternetSetOption.</p></blockquote></div><p>Но эта опция касается только прокси как я понял.<br />Вот и вопрос - какую опцию вызвать, чтобы оповестить запущенный IE об отключении джаваскрипта.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 13 Jun 2015 13:11:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94471#p94471</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94464#p94464</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Скопипастил откуда-то.</p></blockquote></div><p>А ты уверен, что нужный ключ в реестре меняешь? Это зависит от версии IE.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 12 Jun 2015 23:16:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94464#p94464</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94463#p94463</link>
			<description><![CDATA[<p>Скопипастил откуда-то. Кавычки не нужны?<br />Убрал кавычки - результат тот же.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 12 Jun 2015 22:51:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94463#p94463</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94459#p94459</link>
			<description><![CDATA[<p>А цифры в кавычках зачем?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 12 Jun 2015 17:09:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94459#p94459</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Включение/выключение javascript в ie]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=94457#p94457</link>
			<description><![CDATA[<p>Написал такой код, однако он не работает в запущенном IE.<br />Что пропустил?<br /></p><div class="codebox"><pre><code>f11::
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 0
dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
return

f12::
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3,1400, 3
dllcall(&quot;wininet\InternetSetOptionW&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;39&quot;,&quot;int&quot;,&quot;0&quot;,&quot;int&quot;,&quot;0&quot;)
return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 12 Jun 2015 15:10:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=94457#p94457</guid>
		</item>
	</channel>
</rss>
