你好(是的,很长的标题)
我正在制作我的第一个 google chrome 扩展程序,但遇到了一些麻烦。
有关扩展的信息(只是为了让您了解我要做什么):
扩展是一个“收音机”,一个从广播网址播放音乐的 Flash 播放器。在 Flash 播放器的底部,有 4 个图标,其中 3 个在单击时下载 .pls 文件以使用 VLC - WinAmp & iTunes 打开,一个应该打开一个弹出窗口,并显示来自收音机的以下信息。
我想做的是:
1 - 当用户点击图标时(在下图中的红色方块中),应该会打开一个弹出窗口,其中包含一个播放器(Windows 媒体播放器)和一些有关收音机的信息(这些信息是通过 iframe 检索的)
2 - 在扩展中显示 flash 播放器(以及 windows 媒体播放器),这似乎不起作用...
--图片:http : //i.imgur.com/1qZDn.png
编码:
1 - 清单.json:
{
"name": "Kombat Syndicate Radio Extension",
"version": "1.0",
"manifest_version": 2,
"description": "Kombat Syndicate Radio",
"browser_action": {
"default_icon": "icon.png",
"19": "icons/icon.png",
"128": "icons/icon_128.png",
"default_popup": "ksradio.html"
},
"permissions": [
"tabs"
]
}
2 - ksradio.html:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<h1><img style="margin-top:-15px;-webkit-box-reflect: below 0px -webkit- gradient(linear, left top, left bottom, from(transparent), color-stop(87%, transparent), to(white));
" src="icons/ks_radio_icon.png" /><br />Kombat Syndicate Radio</h1>
<div align="center" text-align="center" id="content">
<div id="smallffmp3">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="140" height="80" __idm_id__="1284874242">
<param name="movie" value="http://tracks.kombatsyndicate.com/wp- content/plugins/shout-stream/smallffmp3.swf?url=http://85.25.118.16:7502/;&title=Trac[kS]">
<param name="wmode" value="transparent">
<param name="allowscriptaccess" value="sameDomain"><!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://tracks.kombatsyndicate.com/wp-content/plugins/shout-stream/smallffmp3.swf?url=http://85.25.118.16:7502/;&title=Trac[kS]" width="140" height="80" __idm_id__="1284874243">
<param name="wmode" value="transparent">
<param name="allowscriptaccess" value="sameDomain"><!--<![endif]-->
</object><!--<![endif]-->
</object>
</div>
<a href="http://85.25.118.16:7502/listen.pls" target="_blank"><img src="icons/VLC_48.png" title="VLC Media Player"/></a>
<a href="#" onClick="ksradiowmp()"><img src="icons/WMP_48.png" /></a>
<a href="http://85.25.118.16:7502/listen.pls" target="_blank"><img src="icons/WinAmp_48.png" title="WinAmp Media Player" /></a>
<a href="http://85.25.118.16:7502/listen.pls" target="_blank"><img src="icons/iTunes_48.png" title="iTunes" /></a>
<iframe align="middle" style="display:block;" name="infos" src="http://phpks.comoj.com/radioinfos.php" width="65%" height="70%" frameborder="0" scrolling="no" seamless></iframe>
</div>
</body>
</html>
3 - ksradio_wmp.html(弹出窗口):
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1><img style="margin-top:-15px;-webkit-box-reflect: below 0px -webkit- gradient(linear, left top, left bottom, from(transparent), color-stop(87%, transparent), to(white));
" src="icons/ks_radio_icon.png" /><br />Kombat Syndicate Radio</h1>
<div style="overflow:hidden;" align="center" id="content">
<object id="MediaPlayer1" width="350" height="65" classid="clsid:6bf52a52-394a-11d3- b153-00c04f79faa6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1 ,52,701">
<param name="FileName" value="http://85.25.118.16:7502/" />
<param name="animationatStart" value="true" />
<param name="transparentatStart" value="true" />
<param name="autoStart" value="true" />
<param name="showControls" value="true" />
<param name="fullScreen" value="false" />
<param name="url" value="http://85.25.118.16:7502/" />
<param name="pluginspage" value="http://www.microsoft.com/Windows/MediaPlayer/" />
<param name="autostart" value="1" />
<param name="showcontrols" value="1" />
<embed id="MediaPlayer1" width="350" height="65" type="application/x-mplayer2" src="http://85.25.118.16:7502/" FileName="http://85.25.118.16:7502/" animationatStart="true" transparentatStart="true" autoStart="true" showControls="true" fullScreen="false" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" autostart="1" showcontrols="1" />
</object>
<a href="http://85.25.118.16:7502/listen.pls"><img src="icons/VLC_48.png" title="VLC Media Player"/></a>
<a href="http://85.25.118.16:7502/listen.pls"><img src="icons/WinAmp_48.png" title="WinAmp Media Player" /></a>
<a href="http://85.25.118.16:7502/listen.pls"><img src="icons/iTunes_48.png" title="iTunes" /></a>
<iframe style="display:block;" name="infos" src="http://phpks.comoj.com/radioinfos.php" width="65%" height="70%" frameborder="0" scrolling="no" seamless></iframe>
</div>
</body>
</html>
4 - 脚本.js:
function ksradiowmp() {
window.open("ksradio_wmp.html", "myWindow", "status=1, height=450, width=400, resizable=0, toolbar=no, directories=no, menubar=no, scrollbars=no")
}
PS:这是弹出窗口的样子:http: //i.imgur.com/SwzNW.png
所以要恢复,我需要帮助从扩展打开一个弹出窗口,并在扩展中显示 flash 播放器和 windows 媒体播放器。我真的希望你们能提供帮助:D 在此先感谢。