Linuxä¸ã®Chromeã§åãCacooã¨ãã£ã¿ã¼ã«ã¹ã¯ãªã¼ã³ãã£ããã£ãè²¼ãä»ãã
æå ã®Ubuntuãã·ã³ã§ã¯ãCacooã®ç»é¢ãã£ããã£æ©è½ã使ãã¾ããï¼Sunã®Javaç°å¢ã§ãä¸å¯ï¼ãç»é¢ãã£ããã£ã¯å¤§å¤ä¾¿å©ãªã®ã§ä½ã¨ããããã¨æããChromeæ¡å¼µã®ChromeReplã使ã£ã¦ãã¼ã«ã«ã®ç»åãCacooã®Flashã¢ããªã«éãè¾¼ãã¨ããåé¿çãèãã¾ããã
å°å ¥
æå ã®ç°å¢ã¯ Ubuntu 10.10 x86_64, Chrome 9.0.597.84 beta, Ruby 1.8.7 ã§ããChromeãRubyãapt-getã§å ¥ãæ®éã®ãã®ã§ãããã¨ãç»åãã£ããã£ã« ImageMagick(import, identify) ãå¿ è¦ã§ãã
ãã®ç°å¢ã«å¯¾ã㦠ChromeRepl ãå ¥ãã¾ãã以ä¸ã®ãµã¤ããåèã«ãã¦å ¥ãã¦ãã ãããããã¯ãµã¼ãã¼ã«ãªãChromeæ¡å¼µã¨ãããã¨éä¿¡ããã¯ã©ã¤ã¢ã³ãã®Rubyæ¡å¼µããæãã¾ãã
次ã«ããã£ããã£ãã¦Cacooã«è»¢éããã¹ã¯ãªããã以ä¸ãããã¦ã³ãã¼ããã¦é©å½ãªãã£ã¬ã¯ããªã«é ç½®ãã¾ãã
- https://gist.github.com/835946 / chrome-cacoo-local-capture.rb
使ãæ¹
- ChromeãChromeReplä»ãã§èµ·åãã¾ãã
- Cacooã«ãã°ã¤ã³ãã¦æ°è¦å³ã®ã¨ãã£ã¿ã¼ãèµ·åãã¾ãã
- ãç»é¢ãã£ããã£ãã®ã¢ã¤ã³ã³ãã¯ãªãã¯ãã¦ãã£ããã£ç¨ã®ã¢ãã¬ãããä¸åº¦èµ·åãã¦ããéãã¾ãã
- ãã®æä½ã¯ãã¨ãã£ã¿ã¼ãç«ã¡ä¸ããã¨ãã«ï¼åã ãå¿ è¦ã§ããï¼å°æ¥ç¡ããªãã¨ä¾¿å©ã§ããï¼
- å ã»ã©ãã¦ã³ãã¼ãããã¹ã¯ãªãããå®è¡ãã¦ãé©å½ãªã¦ã¤ã³ãã¦ãã¯ãªãã¯ãã¾ãã
- ãã¾ãããã°Cacooã®ã¨ãã£ã¿ã¼ã«ã¯ãªãã¯ããã¦ã¤ã³ãã¦ã®çµµãè²¼ãä»ãã¾ãã
åé¡ãªããã°ãä¸ã®ã¹ã¯ãªãããé©å½ãªãã¼ã«å²ãå½ã¦ã¦ããã°ä¾¿å©ã«ä½¿ãã¾ãã
åé¡ãèµ·ããã¨ããã°ãä½ã足ããªãã³ãã³ããããã¨ããChromeã®ãã¼ãã«ã¢ã¯ã»ã¹ã§ããªãã¨ããããããæãã ã¨æãã¾ããRubyãå®è¡ããã¨ãã«åºãã¨ã©ã¼ã¡ãã»ã¼ã¸ã確èªãã¦ã¿ã¦ãã ããã
åä½è§£èª¬
ã¹ã¯ãªããã¯é常ã«ã·ã³ãã«ãªã®ã§ãä½ããã¦ãããã¯ããã«åããã¨æãã¾ãã
- importã§ç»é¢ããã£ããã£ãã¦PNGã§ä¿å
- ç»åã®ãµã¤ãºãidentifyã§åå¾
- base64ã§ç»åãã¡ã¤ã«ãæååã«å¤æ
- ChromeReplã§ç¾å¨ã®ã¿ãã®ã°ãã¼ãã«é¢æ°ã«ã¢ã¯ã»ã¹
- Flashã®captureé¢æ°ã«ç»åã®ãã¼ã¿ã渡ã
é©å½ã«æ¹é ãããã¨ã§ããã¼ã«ã«ã®ç»åãé£ç¶ãã¦ã¢ãããã¼ããããªã©ã«ä½¿ããã®ã§ã¯ãªããã¨æãã¾ãã
調æ»
ãã£ããã£ã¢ããªã¨Flashãã©ãéä¿¡ãã¦ãããã調ã¹ãï¼JSã®ã³ã¼ãçºããããjarãéã³ã³ãã¤ã«ãããªã©ï¼ã¨ãããPNGãå¡©ç¡ãã§BASE64ããã¹ãã«å¤æãã¦Flashã«æ¸¡ãã¦ããã¨ãããã¨ãåãã£ãã®ã§ããã¨ã¯ãããå®ç¾ããæ¹æ³ãç´ ç´ã«æã£ã¦ãã¾ããã
JSã¯é£èªåããã¦ãªãéãèªãã¨ããããåãã£ã¦ãããããã§ããã¾ããJavaã«ã¤ãã¦ãéã³ã³ãã¤ã«ãã¦ã³ã¼ããèªãã®ã¯ç¥ã£ã¦ããã¨å½¹ã«ç«ã¤ãã¨ãå¤ãã¨æãã¾ããï¼ãã¡ããEULAã®é¢ä¿ãããã¾ããï¼
ã¡ãªã¿ã«ãä»åã®è¦ä»¶ã¯ãã¾ãã¾ç´ ç´ã«åºæ¥ã¾ããããJavaã¨Flashã®éä¿¡ã®ä»æ¹ã«ãã£ã¦ã¯é£ãããªã£ã¦ããã¨æãã¾ãã
ãã¼ã«ã«ã¨Webã®æ¥ç¶
ChromeReplã«ãã£ã¦ãã¼ã«ã«ã¢ããªã¨Webã¢ããªãã¤ãªããã¨ãåºæ¥ã¾ãããã©ã¦ã¶ã®æä½ã ãã§ãªãã表示ããã¦ããã³ã³ãã³ãã®åå¾ãæä½ãå¯è½ã§ããChromeReplã¯Chromeæ¡å¼µã®ä¸ã§Evalãã¦ããã ãã®ãããªæããªã®ã§ãChromeæ¡å¼µã®è±å¯ãªããã¥ã¡ã³ããèªãã¨è¯ãã¨æãã¾ãã
ä¼¼ããã®ã« MozRepl ãªã©ãããã¾ãã®ã§ãFirefoxã§ãä¼¼ããããªãã¨ã¯åºæ¥ãã¨æãã¾ãã
ãã¨ãã»ãã¥ãªãã£ã«ã¤ãã¦ã¯æ°ãã¤ããå¿ è¦ãããã¨æãã¾ããç´°ããã¨ãããã¤ã£ããã¨ããããããã¨æãã¾ãã®ã§ãä»åã®ã¹ã¯ãªããã§ã¯Cacooã§å³ãè²¼ãããã¨ãã ãChromeReplãæå¹ã«ãããããªä½¿ãæ¹ã«ããã¨è©±ãæ©ãã¨æãã¾ãã
ç¡ä¿è¨¼
ãã®æ¹æ³ã®å ¬éã«ã¤ãã¦Cacooã®ä¸ã®äººã«ã¯äºè§£ã¯åã£ã¦ããã¾ããããµãã¼ãããã¦ããªã使ãæ¹ã§ãã®ã§ãåä½ãæ害ã«ã¤ãã¦ã¯ç¡ä¿è¨¼ã§ãããããããã