├── README.md └── src ├── background.html ├── css └── music.css ├── images ├── icon128.png ├── icon16.png ├── icon48.png ├── icon50.png ├── icons │ ├── 5sing.png │ ├── 9ku.png │ ├── baidu.png │ ├── baidusuixinting.png │ ├── beiwa.png │ ├── bus.png │ ├── douban.png │ ├── duomi.png │ ├── favicon.ico │ ├── fenghuang.png │ ├── google.png │ ├── kugou.png │ ├── kuwo.png │ ├── leku.png │ ├── qingting.png │ ├── qqmusic.png │ ├── renren.png │ ├── sougou.png │ ├── ting.png │ ├── wangyiyunyinyue.png │ ├── weibo.png │ ├── xiami.png │ ├── ximalaya.png │ ├── yige.png │ ├── yinyue.png │ └── yishouge.png └── share │ ├── douban.png │ ├── facebook.png │ ├── google.png │ ├── kaixin.png │ ├── kongjian.png │ ├── qqweibo.png │ ├── qzone.png │ ├── renren.png │ ├── souhu.png │ ├── tieba.png │ ├── twitter.png │ ├── wangyi.png │ └── weibo.png ├── js ├── background.js ├── insert.js ├── jquery.js ├── music.js ├── options.js ├── popup.js └── wdragsort.js ├── manifest.json ├── options.html └── popup.html /README.md: -------------------------------------------------------------------------------- 1 | ## 介绍 2 | 音乐电台是一款chrome扩展,安装之后可以直接在浏览器上听取电台音乐,包含豆瓣电台等14个电台。 3 | 4 | 该插件提供了目前最流行的音乐电台播放,包括:百度听. 豆瓣电台. 酷狗电台. 虾米电台. 酷我电台. 乐酷电台. 多米音乐. 音悦电台. 亦歌电台. 人人电台. 百度mp3音乐盒. 搜狗音乐盒. Google音乐盒。 5 | 6 | 你可以去这里 http://www.welefen.com/tag/music 获取更多的介绍信息。 7 | 8 | ## 安装 9 | 10 | 使用chrome浏览器进入 http://goo.gl/L18RM 页面,点击安装即可。 11 | 12 | ## 更新历史 13 | 14 | **3.0版本更新(2015.4.7)** 15 | 16 | 1. 移除了人人电台、亦歌电台、百度Ting、巴士电台、微博电台、5SING听 17 | 2. 增加了网易云音乐、喜马拉雅、蜻蜓FM、凤凰电台、九酷电台 18 | 3. 修复了百度随心听窗口大小的问题 19 | 20 | **2.6版本更新(2012.9.23)** 21 | 22 | 1. 将扩展的mastfast_version更新到2 23 | 2. 由于Google音乐下线,所以将Google音乐盒删除了 24 | 3. 增加了贝瓦电台和5SING听 2个电台 25 | 4. 链接修复和代码优化 26 | 27 | **2.2版本更新(2011.10.26)** 28 | 29 | 1. 添加了巴士电台 30 | 31 | **2.1.1版本更新(2011.09.28)** 32 | 33 | 1. 修复了分享URL(goo.gl)被新浪微博屏蔽的问题 34 | 35 | **2.1版本更新(2011.09.11)** 36 | 37 | 1. 增加了QQ音乐 38 | 39 | **2.0版本更新(2011.08.16)** 40 | 41 | 1. 进行了重大升级,版本升级到2.0 42 | 2. 音乐播放方式现在有播放模式和下拉模式 43 | 3. 增加了分享功能,可以把这个插件很方便的分享给好友 44 | 45 | **1.15版本更新(2011.07.25)** 46 | 47 | 1. 改变选项页里的电台顺序,根据大家的习惯排序。 48 | 49 | **1.14版本更新(2011.07.19)** 50 | 51 | 1. 打开电台页面时添加了统计,只是想统计哪些电台比较受欢迎(为了之后更好的用户体验),不会获取用户隐私信息,请大家放心。 52 | 53 | **1.13版本更新(2011.07.11)** 54 | 55 | 1. 优化了选项页里操作复杂的问题,现在保存后直接打开电台页面并关闭选项页面。 56 | 57 | **1.12版本更新(2011.06.29)** 58 | 59 | 1. 修复了网速慢导致去不掉百度音乐盒右侧广告的bug 60 | 2. 添加了一首歌电台. 搜狗音乐盒. Google音乐盒 61 | 3. 修复了音乐电台页面查看源代码显示不全的问题 62 | 63 | **1.11版本更新(2011.06.24)** 64 | 65 | 1. 增加了百度音乐掌门人 66 | 2. 修复了多次点击可能会失灵的bug 67 | 68 | **1.10版本更新(2011.06.20)** 69 | 70 | 1. 完成初版,并上传到chrome web store,不再手工维护版本控制,所以这里初始化版本是1.10 71 | -------------------------------------------------------------------------------- /src/background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 音乐电台 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/css/music.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | *{margin:0;padding:0;} 3 | body{background:#fff;font-size:14px;} 4 | ul,li{list-style-type:none;padding:0;margin:0;line-height:30px;} 5 | .clearfix:after{content:'\20';display:block;height:0;clear:both} 6 | .clearfix{zoom:1} 7 | 8 | .mod-options{ 9 | 10 | } 11 | 12 | .mod-popup{ 13 | min-width:100px; 14 | width:112px; 15 | padding:5px; 16 | } 17 | .mod-popup .list li{ 18 | line-height:30px; 19 | height:30px; 20 | cursor:pointer; 21 | padding:0 5px; 22 | -webkit-border-radius:3px; 23 | } 24 | .mod-popup .list li:hover{ 25 | background:#ddd; 26 | } 27 | .mod-popup .list li img{ 28 | -webkit-border-radius:2px; 29 | margin-right:5px; 30 | position:relative; 31 | top:2px; 32 | } 33 | .mod-popup a{ 34 | color:blue; 35 | text-decoration:underline; 36 | } 37 | .mod-popup .share{ 38 | margin-top:5px; 39 | border-top:1px dashed #ccc; 40 | padding-top:5px; 41 | padding-left:5px; 42 | } 43 | .mod-popup .share img{ 44 | cursor:pointer; 45 | } 46 | 47 | 48 | .mod-options{ 49 | border-radius:5px; 50 | width:600px; 51 | margin:auto; 52 | -webkit-box-shadow:0px 0px 10px #ccc; 53 | background:#fff; 54 | padding:20px; 55 | padding-bottom:30px; 56 | margin-top:50px; 57 | } 58 | .mod-options h1{ 59 | padding:0;margin:0; 60 | background:url(../images/icon48.png) no-repeat; 61 | padding-left:55px; 62 | height:48px; 63 | line-height:52px; 64 | color:#4C88BC; 65 | } 66 | .mod-options .c{ 67 | margin-top:40px; 68 | } 69 | .mod-options .c .cate{ 70 | font-size:20px; 71 | font-weight:bold; 72 | } 73 | .mod-options .c .cate li{ 74 | cursor:pointer; 75 | } 76 | .mod-options .c .cate span{ 77 | margin-left:5px; 78 | color:#ccc; 79 | } 80 | .mod-options .c .cate span.s{ 81 | color:#333; 82 | } 83 | .mod-options li{ 84 | float:left; 85 | width:33.3333%; 86 | } 87 | .mod-options button{ 88 | padding:8px 20px;font-size:16px; 89 | } 90 | .mod-options .radio{ 91 | display:inline-block; 92 | width:20px; 93 | height:20px; 94 | border:2px solid #ccc; 95 | -webkit-border-radius:20px; 96 | position:relative; 97 | background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ddd)); 98 | top:3px; 99 | -webkit-background-clip: padding-box; 100 | } 101 | .mod-options .selected{ 102 | display:inline-block; 103 | width:16px; 104 | height:16px; 105 | background:#aaa; 106 | -webkit-border-radius:10px; 107 | position:absolute; 108 | background-image: -webkit-gradient(linear, left top, left bottom, from(#aaa), to(#666)); 109 | top:2px; 110 | left:2px; 111 | -webkit-background-clip: padding-box; 112 | } 113 | .mod-options .selected:hover{ 114 | background-image: -webkit-gradient(linear, left top, left bottom, from(#bbb), to(#888)); 115 | } 116 | .mod-options .options{ 117 | display:none; 118 | } 119 | .mod-options .options{ 120 | padding:10px; 121 | border:1px solid #efefef; 122 | margin-top:10px; 123 | background:#efefef; 124 | -webkit-border-radius:5px; 125 | } 126 | .mod-options .play-mode .item{ 127 | width:33%; 128 | float:left; 129 | font-size:14px; 130 | line-height:30px; 131 | } 132 | .mod-options .select-mode{ 133 | position:relative; 134 | } 135 | .mod-options .select-mode .item{ 136 | background:#fff; 137 | padding:5px 10px; 138 | -webkit-border-radius:5px; 139 | } 140 | .mod-options .select-mode .item li{ 141 | 142 | } 143 | .mod-options .select-mode .po{ 144 | position:absolute; 145 | top:20px; 146 | left:48%; 147 | } 148 | .mod-options .pointer{ 149 | border-left: 10px solid transparent; 150 | border-right: 10px solid transparent; 151 | border-bottom: 10px solid #efefef; 152 | position:absolute; 153 | top:32px; 154 | left:60px; 155 | } 156 | .mod-options .tip{ 157 | margin-top:30px;border-top:1px dashed #ccc;padding-top:10px; 158 | } 159 | .mod-options .share img{ 160 | margin-right:5px; 161 | cursor:pointer; 162 | } 163 | .mod-options .message{ 164 | position:absolute;left:400px;top:15px;color:green;font-size:16px;display:none; 165 | } -------------------------------------------------------------------------------- /src/images/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icon128.png -------------------------------------------------------------------------------- /src/images/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icon16.png -------------------------------------------------------------------------------- /src/images/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icon48.png -------------------------------------------------------------------------------- /src/images/icon50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icon50.png -------------------------------------------------------------------------------- /src/images/icons/5sing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/5sing.png -------------------------------------------------------------------------------- /src/images/icons/9ku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/9ku.png -------------------------------------------------------------------------------- /src/images/icons/baidu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/baidu.png -------------------------------------------------------------------------------- /src/images/icons/baidusuixinting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/baidusuixinting.png -------------------------------------------------------------------------------- /src/images/icons/beiwa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/beiwa.png -------------------------------------------------------------------------------- /src/images/icons/bus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/bus.png -------------------------------------------------------------------------------- /src/images/icons/douban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/douban.png -------------------------------------------------------------------------------- /src/images/icons/duomi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/duomi.png -------------------------------------------------------------------------------- /src/images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/favicon.ico -------------------------------------------------------------------------------- /src/images/icons/fenghuang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/fenghuang.png -------------------------------------------------------------------------------- /src/images/icons/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/google.png -------------------------------------------------------------------------------- /src/images/icons/kugou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/kugou.png -------------------------------------------------------------------------------- /src/images/icons/kuwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/kuwo.png -------------------------------------------------------------------------------- /src/images/icons/leku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/leku.png -------------------------------------------------------------------------------- /src/images/icons/qingting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/qingting.png -------------------------------------------------------------------------------- /src/images/icons/qqmusic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/qqmusic.png -------------------------------------------------------------------------------- /src/images/icons/renren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/renren.png -------------------------------------------------------------------------------- /src/images/icons/sougou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/sougou.png -------------------------------------------------------------------------------- /src/images/icons/ting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/ting.png -------------------------------------------------------------------------------- /src/images/icons/wangyiyunyinyue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/wangyiyunyinyue.png -------------------------------------------------------------------------------- /src/images/icons/weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/weibo.png -------------------------------------------------------------------------------- /src/images/icons/xiami.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/xiami.png -------------------------------------------------------------------------------- /src/images/icons/ximalaya.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/ximalaya.png -------------------------------------------------------------------------------- /src/images/icons/yige.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/yige.png -------------------------------------------------------------------------------- /src/images/icons/yinyue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/yinyue.png -------------------------------------------------------------------------------- /src/images/icons/yishouge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/icons/yishouge.png -------------------------------------------------------------------------------- /src/images/share/douban.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/douban.png -------------------------------------------------------------------------------- /src/images/share/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/facebook.png -------------------------------------------------------------------------------- /src/images/share/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/google.png -------------------------------------------------------------------------------- /src/images/share/kaixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/kaixin.png -------------------------------------------------------------------------------- /src/images/share/kongjian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/kongjian.png -------------------------------------------------------------------------------- /src/images/share/qqweibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/qqweibo.png -------------------------------------------------------------------------------- /src/images/share/qzone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/qzone.png -------------------------------------------------------------------------------- /src/images/share/renren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/renren.png -------------------------------------------------------------------------------- /src/images/share/souhu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/souhu.png -------------------------------------------------------------------------------- /src/images/share/tieba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/tieba.png -------------------------------------------------------------------------------- /src/images/share/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/twitter.png -------------------------------------------------------------------------------- /src/images/share/wangyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/wangyi.png -------------------------------------------------------------------------------- /src/images/share/weibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/welefen/chrome-music/f1aef8e71b8e143375238e4c2e0376b9816dfd81/src/images/share/weibo.png -------------------------------------------------------------------------------- /src/js/background.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | $(function(){ 5 | Music.background.init(); 6 | }) 7 | -------------------------------------------------------------------------------- /src/js/insert.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var musicList = [], 3 | sName = "chrome_music_count", 4 | defaultFn = function(bd){ 5 | bd.style.width = this.width; 6 | bd.style.height = this.height; 7 | bd.style.overflow = 'hidden'; 8 | }, 9 | imglog = function(){ 10 | return true; 11 | var iframe = document.createElement('iframe'); 12 | iframe.style.display = 'none'; 13 | iframe.onload = function(){ 14 | iframe && document.body.removeChild(iframe); 15 | iframe = null; 16 | }; 17 | iframe.src = "http://goo.gl/Lh0P9"; 18 | document.body.appendChild(iframe); 19 | }, 20 | $ = function(el){ 21 | return typeof el == 'string' ? document.getElementById(el) : el; 22 | }, 23 | removeChild = function(el){ 24 | el = $(el); 25 | if(el && el.parentNode){ 26 | el.parentNode.removeChild(el); 27 | } 28 | }, 29 | repaintFn = { 30 | 'kuwo':function(bd){ 31 | bd.style.paddingTop = 0; 32 | }, 33 | "baidu":function(bd){ 34 | var width = this.width, height = this.height, timer = 0, flag = false; 35 | window.addEventListener('load',function(){ 36 | timer = setInterval(function(){ 37 | if(flag){ 38 | clearInterval(timer); 39 | return true; 40 | } 41 | flag = true; 42 | var pg = $('pg'); 43 | pg.style.width = width; 44 | removeChild('girl'); 45 | var p2 = document.querySelector('#top .p2'); 46 | p2.style.width = '160px'; 47 | var p4 = document.querySelector('#top .p4'); 48 | p4.style.width = 'auto'; 49 | window.resizeTo(width, height); 50 | }, 10); 51 | }); 52 | }, 53 | "yishouge":function(bd){ 54 | removeChild('header'); 55 | removeChild('footer'); 56 | $('ysg-player').style.margin = 'auto'; 57 | } 58 | }; 59 | chrome.extension.sendRequest("getMusic", function(response) { 60 | musicList = response; 61 | //alert(JSON.stringify(musicList)) 62 | for(var name in response){ 63 | var url = response[name].url; 64 | if(url && location.href.indexOf(url) === 0){ 65 | var repaint = repaintFn[name]; 66 | if(name !== 'ting' && location.href.indexOf('#welefen') > -1){ 67 | defaultFn && defaultFn.call(response[name], document.body); 68 | repaint && repaint.call(response[name], document.body); 69 | } 70 | //重新设置localStorage 71 | chrome.extension.sendRequest({setItem:'1'}, function(response) { }); 72 | //添加统计 73 | window.addEventListener("load", function(){ 74 | setTimeout(function(){ 75 | imglog(); 76 | }, 3000); 77 | }); 78 | break; 79 | } 80 | } 81 | }); 82 | chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { 83 | if(request == "close"){ 84 | for(var name in musicList){ 85 | var url = musicList[name].url; 86 | if(url && location.href.indexOf(url) === 0){ 87 | window.open('', '_self', ''); //chrome下通过这种方式可以关闭不能关闭的窗口 88 | window.close(); 89 | return true; 90 | } 91 | } 92 | } 93 | }); 94 | })(); -------------------------------------------------------------------------------- /src/js/music.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 音乐电台操作相关的接口 3 | * author: welefen 4 | */ 5 | window.Music = (function(){ 6 | var music = { 7 | init: function(){ 8 | 9 | }, 10 | //电台列表 11 | list: { 12 | "douban":{ 13 | url:"http://douban.fm/radio", 14 | width:420, 15 | height:186, 16 | name: "豆瓣电台" 17 | }, 18 | "kugou":{ 19 | url: "http://topic.kugou.com/radio/", 20 | width: 740, 21 | height: 450, 22 | name: "酷狗电台" 23 | }, 24 | "xiami":{ 25 | url:"http://kuang.xiami.com/kuang/play/xiamiradio", 26 | width:535, 27 | height:280, 28 | name: "虾米电台" 29 | }, 30 | "kuwo":{ 31 | url:"http://player.kuwo.cn/webmusic/webdiantai/kuwoBaiduPlay.jsp", 32 | width:535, 33 | height:285, 34 | name: "酷我电台" 35 | }, 36 | "leku":{ 37 | url:"http://music.sina.com.cn/app/baidu/index.php", 38 | width:400, 39 | height:200, 40 | name: "乐酷电台" 41 | }, 42 | "duomi":{ 43 | url:"http://app.duomiyy.com/songplayer/baidu", 44 | width:445, 45 | height:200, 46 | name: "多米电台" 47 | }, 48 | "yinyue":{ 49 | url:"http://www.yinyuetai.com/baidu/index", 50 | width:800, 51 | height:445, 52 | name: "音悦TV" 53 | }, 54 | "baidu":{ 55 | url:"http://box.zhangmen.baidu.com/m?rf=idx&ct=134217728&tn=baidumt&gate=5", 56 | width:510, 57 | height:575, 58 | name: "百度音乐盒" 59 | }, 60 | "baidusuixinting":{ 61 | url:"http://fm.baidu.com/?embed=ps&bd_user=285491895&bd_sig=b5ec229dfab366de259922435b8156c0", 62 | width:878, 63 | height:576, 64 | name: "百度随心听" 65 | }, 66 | "sougou":{ 67 | url:"http://player.mbox.sogou.com/player", 68 | width:625, 69 | height:560, 70 | name: "搜狗音乐盒" 71 | }, 72 | "qqmusic":{ 73 | url:"http://music.qq.com/musicbox/player/music_player_webqq.html", 74 | width:360, 75 | height:415, 76 | name: "QQ音乐" 77 | }, 78 | "beiwa":{ 79 | url:"http://app.beva.com/baidu/fm/show-i10001.html?bd_user=285491895&bd_sig=8ec1cd56d06aa8e43bf2d4811e494aeb&canvas_pos=platform", 80 | width:540, 81 | height:550, 82 | name: "贝瓦电台" 83 | }, 84 | "wangyiyunyinyue":{ 85 | url:"http://music.163.com/#/my/", 86 | width: 1000, 87 | height:550, 88 | name: "网易云音乐" 89 | }, 90 | "ximalaya":{ 91 | url:"http://zhubo.ximalaya.com/", 92 | width: 1000, 93 | height:550, 94 | name: "喜马拉雅" 95 | }, 96 | "qingting":{ 97 | url:"http://www.qingting.fm/#/home", 98 | width: 1000, 99 | height:550, 100 | name: "蜻蜓FM" 101 | }, 102 | "fenghuang":{ 103 | url:"http://diantai.ifeng.com/", 104 | width: 1000, 105 | height:550, 106 | name: "凤凰电台" 107 | }, 108 | "9ku":{ 109 | url:"http://www.9ku.com/fm/", 110 | width: 1000, 111 | height:550, 112 | name: "九酷电台" 113 | } 114 | }, 115 | //获取随机电台名 116 | getRandomMusicName: function(){ 117 | var list = Object.getOwnPropertyNames(music.list), len = list.length; 118 | var r = Math.min(Math.floor(Math.random()*len), len-1); 119 | return list[r]; 120 | }, 121 | //获取电台对应的配置 122 | getMusic: function(){ 123 | var name = localStorage.getItem(music.config.storageName); 124 | if(!(name in music.list)){ 125 | name = "random"; 126 | } 127 | if(name == 'random'){ 128 | name = music.getRandomMusicName(); 129 | } 130 | return music.list[name]; 131 | }, 132 | //打开一个电台 133 | play: function(type){ 134 | if(type){ 135 | localStorage.setItem(music.config.storageName, type); 136 | } 137 | var count = localStorage.getItem(music.config.sName) | 0, 138 | check = localStorage.getItem(music.config.aName) | 0; 139 | if(count == 1){ 140 | if(check == 0){ 141 | localStorage.setItem(music.config.aName, 1); 142 | //return true; 143 | }else{ 144 | localStorage.setItem(music.config.aName, 0); 145 | localStorage.setItem(music.config.sName, 0); 146 | } 147 | } 148 | music.closeOthers(function(){ 149 | var m = music.getMusic(); 150 | var pros = 'scrollbars=no,width='+m.width+',height='+m.height+',top=100,left=100,toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no'; 151 | localStorage.setItem(music.config.sName, 1); 152 | setTimeout(function(){ 153 | window.open(m.url+'#welefen', 'popup', pros); 154 | }, 100) 155 | }); 156 | }, 157 | //关闭其他已经打开的电台页面 158 | closeOthers: function(callback){ 159 | chrome.windows.getAll({}, function(wins){ 160 | wins.forEach(function(win){ 161 | var winid = win.id; 162 | chrome.tabs.getAllInWindow(winid, function(tabs){ 163 | tabs.forEach(function(tab){ 164 | chrome.tabs.sendRequest(tab.id, "close", function(response){ 165 | 166 | }); 167 | }); 168 | }); 169 | }); 170 | callback && callback(); 171 | }); 172 | }, 173 | //获取当前播放模式 174 | getMode: function(){ 175 | var mode = localStorage.getItem(music.config.mName) || "play"; 176 | return mode; 177 | } 178 | }; 179 | var share = music.share = { 180 | list: { 181 | "qzone": { 182 | url: "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey", 183 | name: "QQ空间", 184 | params: { 185 | url: "%url%", 186 | title: "%title%", 187 | summary: "%summary%" 188 | } 189 | }, 190 | "weibo": { 191 | url: "http://service.weibo.com/share/share.php", 192 | name: "新浪微博", 193 | params: { 194 | pic: "", 195 | source: "bookmark", 196 | appkey: "2992571369", 197 | ralateUid: "", 198 | url: "%sourceUrl%", 199 | title: "%title% %sourceUrl%" 200 | } 201 | }, 202 | "qqweibo": { 203 | url: "http://v.t.qq.com/share/share.php", 204 | name: "QQ微博", 205 | params: { 206 | pic: "", 207 | site: "www.welefen.com", 208 | appkey: "118cd1d635c44eab9a4840b2fbf8b0fb", 209 | url: "%url%", 210 | title: "%title%" 211 | } 212 | }, 213 | "renren": { 214 | url: "http://share.renren.com/share/buttonshare.do", 215 | name: "人人网", 216 | params: { 217 | link: "http://www.welefen.com/music-chrome-plugin-upgrade-to-2.html", 218 | title: "%title%" 219 | } 220 | }, 221 | "kaixin": { 222 | url: "http://www.kaixin001.com/repaste/share.php", 223 | name: "开心网", 224 | params: { 225 | rurl: "%url%", 226 | rtitle: "%title%", 227 | rcontent: "%summary%" 228 | } 229 | }, 230 | "souhu": { 231 | url: "http://t.sohu.com/third/post.jsp", 232 | name: "搜狐微博", 233 | params: { 234 | title: "%title%", 235 | url: "%url%", 236 | content: "%summary%" 237 | } 238 | }, 239 | "douban": { 240 | url: "http://shuo.douban.com/!service/share", 241 | name: "豆瓣", 242 | params: { 243 | name: "%title%", 244 | href: "%url%" 245 | } 246 | }, 247 | "wangyi": { 248 | url: "http://t.163.com/article/user/checkLogin.do", 249 | name: "网易微博", 250 | params: { 251 | source: "%title%", 252 | info: "%url% %summary%" 253 | } 254 | }, 255 | "tieba": { 256 | url: "http://tieba.baidu.com/i/app/open_share_api", 257 | name: "i贴吧", 258 | params: { 259 | link: "%url%" 260 | } 261 | }, 262 | "kongjian": { 263 | url: "http://apps.hi.baidu.com/share/", 264 | name: "百度空间", 265 | params: { 266 | url: "%url%", 267 | title: "%title%" 268 | } 269 | }, 270 | "facebook": { 271 | url: "http://www.facebook.com/sharer.php", 272 | name: "Facebook", 273 | params: { 274 | u: "%url%", 275 | t: "%title%" 276 | } 277 | }, 278 | "twitter": { 279 | url: "http://twitter.com/intent/tweet", 280 | name: "Twitter", 281 | params: { 282 | source: "webclient", 283 | text: "%summary% %url%" 284 | } 285 | } 286 | }, 287 | build: function(container, list, margin){ 288 | list = list || Object.keys(share.list); 289 | margin = margin || 3; 290 | var html = [], i = 0; 291 | $.each(list, function(j, item){ 292 | if(item in share.list){ 293 | html[i++] = ''; 294 | } 295 | }); 296 | $(html.join('')).appendTo($(container)); 297 | share.delegate(container); 298 | }, 299 | delegate: function(container){ 300 | $(container).delegate('.share-icon', 'click', function(){ 301 | share.open(this.name); 302 | share.imglog(); 303 | }); 304 | }, 305 | imglog: function(url){ 306 | return true; 307 | var iframe = document.createElement('iframe'); 308 | url = url || "9qfce"; 309 | iframe.style.display = 'none'; 310 | iframe.onload = function(){ 311 | iframe && document.body.removeChild(iframe); 312 | iframe = null; 313 | }; 314 | iframe.src = "http://goo.gl/"+url; 315 | document.body.appendChild(iframe); 316 | }, 317 | param: function(params){ 318 | var result = {}; 319 | $.each(params, function(key, value){ 320 | result[key] = value.replace(/\%(url|title|summary|sourceUrl)\%/g, function(a, b){ 321 | return music.config[b]; 322 | }); 323 | }); 324 | return $.param(result); 325 | }, 326 | open: function(name){ 327 | var options = share.list[name]; 328 | var url = options.url; 329 | if(options.params){ 330 | url += '?' + share.param(options.params); 331 | } 332 | window.open(url); 333 | } 334 | }; 335 | var options = music.options = { 336 | mode: 'play', 337 | init: function(){ 338 | var mode = music.getMode(); 339 | options.mode = mode; 340 | music.options.showTab(mode); 341 | $('.mod-options .cate li').each(function(i){ 342 | $(this).click(function(){ 343 | music.options.showTab(i); 344 | options.mode = (i == 0 ? 'play' : 'select'); 345 | $('.pointer').animate({ 346 | left: i === 0 ? 58 : 260 347 | }); 348 | }); 349 | }); 350 | options.initPlayOptions(); 351 | options.initSelectOptions(); 352 | }, 353 | //初始化播放模式 354 | initPlayOptions: function(){ 355 | var i = 0,name, value, html = [], sname = localStorage.getItem(music.config.storageName), flag = false, checked; 356 | for(name in music.list){ 357 | value = music.list[name]; 358 | if(sname === name){ 359 | checked = 'checked'; 360 | flag = true; 361 | }else{ 362 | checked = ''; 363 | } 364 | html[i++] = ['
' 370 | ].join(''); 371 | } 372 | html[i++] = ['
' 375 | ].join(''); 376 | $($('.mod-options .options')[0]).html(html.join('')); 377 | }, 378 | getItemHtml: function(name, value){ 379 | var im = ['
  • ' 382 | ].join(''); 383 | return im; 384 | }, 385 | //初始化下拉模式 386 | initSelectOptions: function(){ 387 | var ihtml = [], shtml = [], i =0, item = options.getSelectItem(), name, value; 388 | for(var i=0,len=item.length;ili").wDragSort({ 406 | start: function(selector, li){ 407 | var ul = li.parent(); 408 | if(ul.find('>li').length === 2){ 409 | return false; 410 | } 411 | } 412 | //undrager: "div#MoreDemo ul.wDragSort>li.disabled" //不允许拖动对象 413 | }); 414 | }, 415 | //获取已经保存的电台 416 | getSelectItem: function(){ 417 | var items = localStorage.getItem(music.config.iName) || 'douban,xiami,renren,kugou,yinyue'; 418 | items = items.split(','); 419 | return items; 420 | }, 421 | //展现哪个模式 422 | showTab: function(mode){ 423 | var d = $('.mod-options .cate li>div>div'), 424 | s = $('.mod-options .cate li>span'), 425 | options = $('.mod-options .options'), 426 | i = typeof mode === 'number' ? mode : (mode === 'play' ? 0 : 1); 427 | $(d[i]).addClass('selected'); 428 | $(d[1-i]).removeClass('selected'); 429 | $(s[i]).addClass('s'); 430 | $(s[1-i]).removeClass('s'); 431 | $(options[i]).show(); 432 | $(options[1-i]).hide(); 433 | $('.pointer').animate({ 434 | left: i === 0 ? 58 : 260 435 | }); 436 | }, 437 | //保存选项 438 | save: function(){ 439 | var mode = options.mode; 440 | if(mode === 'play'){ 441 | var lis = $('label>input', $('.mod-options .options')[0]); 442 | localStorage.setItem(music.config.mName, mode); 443 | lis.each(function(){ 444 | if(this.checked){ 445 | localStorage.setItem(music.config.storageName, this.value); 446 | chrome.extension.sendRequest('options', function(response) { 447 | //var error = chrome.extension.lastError(); 448 | //alert(JSON.stringify(error)) 449 | //window.open('', '_self', ''); //chrome下通过这种方式可以关闭不能关闭的窗口 450 | //window.close(); 451 | }); 452 | return false; 453 | } 454 | }); 455 | chrome.browserAction.setPopup({popup: ""}); 456 | }else{ 457 | var lis = $($('.mod-options .select-mode .item')[1]).find('>li'); 458 | var result = []; 459 | lis.each(function(){ 460 | result.push($(this).attr('name')); 461 | }); 462 | localStorage.setItem(music.config.iName, result.join(',')); 463 | localStorage.setItem(music.config.mName, mode); 464 | chrome.browserAction.setPopup({popup: "popup.html"}); 465 | } 466 | $('.message').show(); 467 | setTimeout(function(){ 468 | $('.message').hide(); 469 | share.imglog("bAxkD"); 470 | }, 1500) 471 | } 472 | }; 473 | var background = music.background = { 474 | init: function(){ 475 | //content_scripts需要musicList 476 | chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { 477 | //alert(JSON.stringify(request)) 478 | if(request == 'getMusic'){ 479 | sendResponse(music.list); 480 | }else if(request == 'setItem'){ 481 | localStorage.setItem(music.config.sName, 0); 482 | localStorage.setItem(music.config.aName, 0); 483 | }else if(request == 'options'){ 484 | music.play(); 485 | sendResponse({ 486 | options: 'close' 487 | }); 488 | }else if(request == 'popup'){ 489 | music.play(); 490 | } 491 | }); 492 | // 493 | var type = 0; 494 | if(music.background.checkVersion()){ 495 | music.background.setBadge(); 496 | type = 1; 497 | } 498 | music.background.setClickedHandle(type); 499 | }, 500 | //检测存储的版本和当前的版本关系 501 | checkVersion: function(){ 502 | var cv = music.config.currentVersion | 0, 503 | sv = localStorage.getItem(music.config.vName) | 0; 504 | return cv > sv; 505 | }, 506 | //在icon上添加提醒文字, 之在一级版本发生改动时添加 507 | setBadge: function(){ 508 | chrome.browserAction.setBadgeText({text:"new"}); 509 | chrome.browserAction.setBadgeBackgroundColor({color:[0, 200, 0, 100]}); 510 | }, 511 | //移除icon上的字体 512 | removeBadge: function(){ 513 | localStorage.setItem(music.config.vName, music.config.currentVersion); 514 | chrome.browserAction.setBadgeText({text:""}); 515 | }, 516 | //设置icon点击事件 517 | setClickedHandle: function(type){ 518 | var mode = music.getMode(); 519 | if(mode != 'play'){ 520 | if(type === 1){ 521 | chrome.browserAction.onClicked.addListener(function(){ 522 | if(type === 1){ 523 | window.open("options.html"); 524 | music.background.removeBadge(); 525 | type = 0; 526 | chrome.browserAction.setPopup({popup: "popup.html"}); 527 | }else{ 528 | //chrome.browserAction.setPopup({popup: "popup.html"}); 529 | } 530 | }) 531 | }else{ 532 | chrome.browserAction.setPopup({popup: "popup.html"}); 533 | } 534 | }else{ 535 | chrome.browserAction.onClicked.addListener(function(){ 536 | if(type === 1){ 537 | window.open("options.html"); 538 | music.background.removeBadge(); 539 | type = 0; 540 | }else{ 541 | //music.background.removeBadge(); 542 | music.play(); 543 | } 544 | }); 545 | } 546 | } 547 | }; 548 | var popup = music.popup = { 549 | init: function(){ 550 | var items = music.options.getSelectItem(), html = [], i = 0; 551 | $.each(items, function(){ 552 | var item = music.list[this+'']; 553 | html[i++] = '
  • '+item.name+'
  • '; 554 | }) 555 | $('.mod-popup .list').html(html.join('')); 556 | $('.mod-popup .list .diantai').click(function(){ 557 | var name = $(this).attr('name'); 558 | Music.play(name); 559 | }) 560 | } 561 | } 562 | music.config = { 563 | storageName: "chrome_music_name", 564 | sName: "chrome_music_count", 565 | aName: "chrome_music_check", 566 | vName: "chrome_music_version", //保存的版本 567 | mName: "chrome_music_mode", //听歌的模式 568 | iName: "chrome_music_select_list", 569 | currentVersion: 3.0, //当前版本 570 | 571 | url: "http://goo.gl/oEGAE", 572 | sourceUrl: "http://t.cn/aRtsS7", 573 | title: "Chrome音乐电台插件", 574 | summary: "我发现一个Chrome下一个听歌非常方便的插件,支持豆瓣、虾米、酷狗等14种电台哦,你也试试吧。" 575 | }; 576 | return music; 577 | })(); -------------------------------------------------------------------------------- /src/js/options.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | $(function(){ 5 | Music.options.init(); 6 | Music.share.build($('.share'), null, 8); 7 | $('button.save').click(function(){ 8 | Music.options.save(); 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /src/js/popup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | $(function(){ 5 | Music.share.build($('.share'), 'qzone,qqweibo,weibo,renren'.split(',')); 6 | Music.popup.init(); 7 | }) 8 | -------------------------------------------------------------------------------- /src/js/wdragsort.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery JavaScript Library v1.4.2 3 | * http://jquery.com/ 4 | * http://www.wobumang.com/FenXiang/jquery/wDragSort 5 | * wDragSort 1.0 by xusion create 2011-03-10 jQuery的拖曳排序函数 6 | * 使用方法:$(selector).wDragSort(opts) 7 | */ 8 | 9 | $.fn.extend({ 10 | wDragSort: function (opts) { 11 | //默认设置 12 | opts = $.extend({ 13 | undrager: null, //不允许拖动对象/选择器 14 | start: function (selector, drager) { }, //自定义事件:开始事件-> drager:被拖动对象 15 | move: function (selector, drager, targeter, helper) { }, //自定义事件-> 移动事件 drager:被拖动对象 targeter:目标对象 helper:助对象 16 | end: function (selector, drager) { } //自定义事件:线束事件-> drager:被拖动对象 17 | }, opts || {}); 18 | 19 | //初始化 20 | var cssDrag = "wdragsort"; 21 | var cssUndrag = "wdragsort-undrags"; 22 | var cssHelper = "wdragsort-helper"; 23 | var $selector = $(this); 24 | $selector.each(function (index) { 25 | $(this).attr(cssDrag, index).addClass(cssDrag); 26 | }); 27 | 28 | //不允许拖动对象 29 | if (opts.undrager) { 30 | $(opts.undrager).addClass(cssUndrag); 31 | } 32 | 33 | //绑定事件 34 | $selector.filter(":not(." + cssUndrag + ")").unbind("mousedown", mouseDown).mousedown(mouseDown); 35 | 36 | 37 | function mouseDown(e) { 38 | var oriX, oriY; //要移动的li的初始值; 39 | var setX, setY; //鼠标按下处和li的左上角的距离; 40 | var $theli = $(this); //要拖动的li对象 41 | var $helpli = $theli.clone(); //辅助li对象 42 | $(document.body).css('-webkit-user-select', 'none'); 43 | //获取坐标 44 | oriX = $theli.position().left; 45 | oriY = $theli.position().top 46 | setX = e.clientX - oriX; 47 | setY = e.clientY - oriY; 48 | $helpli.css({ position: "absolute", top: oriY, left: oriX }).attr(cssDrag, cssHelper).addClass(cssHelper); 49 | $theli.css({ visibility: "hidden" }).after($helpli); 50 | //自定义事件 开始事件 51 | try { var re = opts.start($selector, $theli); 52 | if(re === false) { 53 | $theli.css({ visibility: "" }).before($helpli); 54 | $helpli.remove(); 55 | return false; 56 | } 57 | } catch (ex) { throw ex; } 58 | 59 | //绑定事件 60 | $(document).mousemove(mouseMove); 61 | $(document).mouseup(mouseUp); 62 | 63 | 64 | function mouseMove(e) { 65 | //移动辅助对象 66 | var liX = e.clientX - setX; 67 | var liY = e.clientY - setY; 68 | $helpli.css({ "left": liX, "top": liY }); 69 | deisabledSelection(); 70 | 71 | //查找目标 72 | $selector.each(function () { 73 | var pST = $(document).scrollTop(); 74 | var pSL = $(document).scrollLeft(); 75 | var pXL = $(this).offset().left - pSL; 76 | var pXM = pXL + $(this).width() / 2; 77 | var pXR = pXL + $(this).width(); 78 | var pYT = $(this).offset().top - pST ; 79 | var pYB = pYT + $(this).height(); 80 | 81 | if ($(this).attr(cssDrag) != $theli.attr(cssDrag) && $(this).attr(cssDrag) != cssHelper) { 82 | if (pYT <= e.clientY && e.clientY <= pYB) { 83 | var $target = null; 84 | if (pXL <= e.clientX && e.clientX <= pXM) { 85 | $target = $(this).before($theli); 86 | } 87 | else if (pXM <= e.clientX && e.clientX <= pXR) { 88 | $target = $(this).after($theli); 89 | } 90 | 91 | //自定义事件 移动事件 92 | if ($target != null) { 93 | try { opts.move($selector, $theli, $target, $helpli); } catch (ex) { throw ex; } 94 | } 95 | } 96 | } 97 | }); 98 | }; 99 | 100 | function mouseUp(e) { 101 | $(document.body).css('-webkit-user-select', 'auto'); 102 | //移动目标 103 | $theli.css({ visibility: "" }).before($helpli); 104 | $helpli.remove(); 105 | 106 | //清除事件 107 | $(document).unbind("mousemove", mouseMove); 108 | $(document).unbind("mouseup", mouseUp); 109 | 110 | //自定义事件 结束事件 111 | try { opts.end($selector, $theli); } catch (ex) { throw ex; } 112 | }; 113 | }; 114 | 115 | //防止拖动中选中 116 | function deisabledSelection() { 117 | if (document.selection) {//IE ,Opera 118 | if (document.selection.empty) { document.selection.empty(); } //IE 119 | else { document.selection = null; } //Opera 120 | } 121 | else if (window.getSelection) {//FF,Safari 122 | window.getSelection().removeAllRanges(); 123 | } 124 | } 125 | } 126 | }); 127 | 128 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "音乐电台", 4 | "version": "3.0", 5 | "description": "最强大的音乐电台插件,支持百度听、豆瓣电台、酷狗电台、虾米电台、酷我电台、乐酷电台、多米音乐、音悦电台、亦歌电台、人人电台、一首歌电台、百度音乐盒、搜狗音乐盒、Google音乐盒、QQ音乐、巴士电台等。", 6 | "background": { 7 | "page": "background.html" 8 | }, 9 | "content_security_policy": "script-src 'self'; object-src 'self'", 10 | "homepage_url":"http://www.welefen.com/music-chrome-plugin-upgrade-to-2.html", 11 | "browser_action": { 12 | "default_icon": "images/icon16.png", 13 | "default_title": "音乐电台" 14 | }, 15 | "content_scripts": [ 16 | { 17 | "matches": ["*://*/*"], 18 | "js": ["js/insert.js"], 19 | "run_at":"document_end" 20 | } 21 | ], 22 | "permissions":["tabs"], 23 | "icons": { 24 | "16": "images/icon16.png", 25 | "48": "images/icon48.png", 26 | "50": "images/icon50.png", 27 | "128": "images/icon128.png" 28 | }, 29 | "options_page":"options.html" 30 | } 31 | -------------------------------------------------------------------------------- /src/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 音乐电台选项 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 |
    19 |

    音乐电台选项

    20 |
    21 |
    22 |
      23 |
    • 24 |
      25 |
      26 |
      27 | 播放模式
    • 28 |
    • 29 |
      30 |
      31 |
      32 | 下拉模式
    • 33 |
    34 |
    35 |
    36 |
      37 |
        38 |
        注:将想要收听的电台从上面拖拽到下面,然后保存即可。
        39 |
        40 |
        41 | 42 | 保存成功
        43 |
        感觉不错,分享给好友哈: 反馈建议
        45 |
        46 |
        让人垂涎欲滴的美女,爽爆了。
        47 | 48 | 49 | -------------------------------------------------------------------------------- /src/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 音乐电台选项 6 | 7 | 8 | 9 | 10 | 11 | 12 |
        13 |
          14 | 17 |
          18 | 19 | --------------------------------------------------------------------------------