当点击谷歌chrome扩展插件内的链接并在扩展插件中插入flash播放器时,打开弹出窗口



你好(是的,标题很长)

我正在制作我的第一个谷歌chrome扩展,我遇到了一些麻烦。

有关扩展的信息(只是为了让您了解我想要做什么):

扩展是一个"Radio",一个从shoutcast url播放音乐的flash播放器。并且在flash播放器的底部,有4个图标,其中3个当点击下载一个.pls文件以打开VLC-WinAmp&iTunes和一个应该打开一个弹出窗口,下面显示的是来自收音机的信息。

我想做的是:

1-当用户点击图标(下图中的红色方块)时,弹出窗口将显示播放器(windows媒体播放器)和一些关于收音机的信息(信息通过iframe检索)

2-在扩展中显示flash播放器(以及windows媒体播放器),这似乎不起作用。。。

--图片:https://i.stack.imgur.com/jWCuh.png

代码:

1-manifest.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/;&amp;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/;&amp;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-script.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")
}

p.S:弹出窗口应该是这样的:https://i.stack.imgur.com/NTBxn.png

因此,为了继续,我需要帮助从扩展中打开一个弹出窗口,并在扩展中显示flash播放器和windows媒体播放器。我真的希望你们能帮忙:D提前谢谢。

消除的所有实例

a)value="http://tracks.kombatsyndicate.com/wp- content/plugins/shout-stream/smallffmp3.swf?url=http://85.25.118.16:7502/;&amp;title=Trac[kS]"

b)href="http://85.25.118.16:7502/listen.pls"

c)onClick="ksradiowmp()"

有关更多信息,请参阅在chrome扩展中传递的基本消息似乎无法通过

如果你需要更多信息,请告诉我。

最新更新