SWT Browser in eclipse and Javascript

I made an simple browser in eclipse by SWT, and I want to execute javascript for downloading Youtube video; it works in chrome. I tried with `browser.execute()`, but nothing happens; it should start downloading. script: javascript: isIE = /*@cc_on!@*/ false; isIE ? swfHTML = document.getElementById('movie_player').getElementsByTagName('param')[1].value : swfHTML = document.getElementById("movie_player").getAttribute("flashvars"); w = swfHTML.split("&"); for (i = 0; i <= w.length - 1; i++) if (w[i].split("=")[0] == "url_encoded_fmt_stream_map") { links = unescape(w[i].split("=")[1]); break; } abc = links.split(",url="); for (i = 0; i <= abc.length - 1; i++) { fmt = abc[i].split("|")[0]; if ((fmt.indexOf("flv") > 0) && (fmt.indexOf("large") <= 0) && (fmt.indexOf("medium") <= 0)) { if (fmt.indexOf("rl=") > 0) { url = fmt.substring(4, fmt.indexOf("fallback_host") - 1); url = unescape(unescape(url)); break; } else { url = fmt.substring(0, fmt.indexOf("fallback_host") - 1); url = unescape(unescape(url)); break; } } } combineurl = url; combineurl = combineurl + '&title=' + ((((document.title.replace('#', ' ')).replace('@', ' ')).replace('*', ' ')).replace('|', ' ')).replace(':', ' '); window.location.href = combineurl.substring(0, 2000);
Reformatted by jsbeautifier.

以上就是SWT Browser in eclipse and Javascript的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏