<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Через chrome.ahk получить список вкладок и закрыть по условию?]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16571&amp;type=atom" />
	<updated>2021-09-05T17:47:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16571</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Через chrome.ahk получить список вкладок и закрыть по условию?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=149477#p149477" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Gh0sTG0 пишет:</cite><blockquote><p>Может ли chrome.ahk закрывать вкладки?</p></blockquote></div><p>Если кому понадобится:<br /></p><div class="codebox"><pre><code>profile := A_Temp . &quot;\ChromeProfile&quot;
url1 := &quot;https://vk.com/&quot;
url2 := &quot;https://forum.script-coding.com/&quot;

ChromeInst := new Chrome(profile, [url1, url2])
Loop 20 {
   try Page := ChromeInst.GetPageByURL(url2)
   Sleep 1000
} until Page
if !Page
   throw &quot;Failed to get the Page object&quot;
Page.WaitForLoad()
res := Page.Call(&quot;Target.getTargets&quot;)
for k, v in res.targetInfos {
   if (v.type = &quot;page&quot; &amp;&amp; v.url = url1) {
      targetId := v.targetId
      break
   }
}
MsgBox, Сейчас страница ВКонтакте будет закрыта
Page.Call(&quot;Target.closeTarget&quot;, {targetId: targetId, success: true})</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-09-05T17:47:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=149477#p149477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Через chrome.ahk получить список вкладок и закрыть по условию?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=149475#p149475" />
			<content type="html"><![CDATA[<p>Добрый вечер.<br />Хочу в хроме реализовать подметалку лишних вкладок по условию.<br />Т.е. чтобы при нажатии кнопки гуя, выполнялись следующие действия:<br />1) <em>получить список url&#039;ов открытых вкладок.</em> вроде как разобрался через getpagelist и потом loop из getpage(значение из листа).<br />2) Может ли chrome.ahk закрывать вкладки? Или, может быть, как то можно переместить вкладку в отдельное окно? И потом, просто ahk это окно закрыть?</p><p>Енто по идее можно удалить, я решил проблему совсем другим способом.</p>]]></content>
			<author>
				<name><![CDATA[Gh0sTG0]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39523</uri>
			</author>
			<updated>2021-09-04T23:13:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=149475#p149475</id>
		</entry>
</feed>
