Re: 自動按鍵的 win32 程

看板Programming作者時間15年前 (2010/12/01 13:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/7 (看更多)
On 2010/12/1 上午 12:19, 習慣 wrote: > ※ 引述《Wayne<example@example.net>, 看板: Programming》之銘言: > : On 2010/11/29 上午 01:00, 璉璉 wrote: > :> 是,再加上 SendMessage 來送出確定紐。 > :> 沒有。 > :> 因為這算是正常的流程,當然不會另外準備個 API 讓你跳掉。 > : 首先謝謝這位網友的回答 > : 目前我找到的大概方法是設定 firefox 的 security policies 將特定網址停用 > : alert 或 comfirm > : 請參考 http://www.mozilla.org/projects/security/components/ConfigPolicy.html > : 不過 firefox 會丟出 exception 導致接下來的 javascript 都不會執行 > : 接下來就要研究如何處理丟出來的 exceptions ........... > > 因為這篇文章前文被吃掉了,所以我不確定目的所在。 > > 不過如果只是處理網頁點擊,關閉 alert 或 confirm , prompt 的 window > > 在 firefox 底下其實用 chickenfoot 這支 extension 寫 script > > 就可以模仿人手點擊網頁的操作。 謝謝這位熱心的網友回答 這個外掛之前有使用過,不過在使用這範例 http://groups.csail.mit.edu/uid/chickenfoot/scripts/index.php?title=Handling_alert_or_confirm_windows 的時候遇到一個問題 我作業用的網頁結構是 <html> <head><title>Hello Programming</title></head> <body> <form> <script type="text/javascript"> //<![CDATA[ confirm('ask something'); //]]> </script> </form> </body> </html> 也就是說這網頁執行到一半就會跑出 confirm 等按了confirm 完後才會繼續解析 我查的資料說 greasemonkey 是網頁解析完後才會執行 我觀察到 chickenfeed也是在按了 confirm 後等網頁解析完才會執行 所以我依舊無法避開手動去按的動作 如果用 firefox 的 security policices 關掉alert或confirm的話 根據網頁敘述跟實際運作 firefox 會丟出例外並且停止接下來的 javascript 運作 這樣我工作上的網頁其他功能就無法動了 Orz 不知道有什麼方法能抓到或避開firefox丟出的例外讓接下來的code繼續運作
文章代碼(AID): #1CzTQFez (Programming)
文章代碼(AID): #1CzTQFez (Programming)