您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
doubanFM searching in netease cloud music
当前为
// ==UserScript== // @name doubanFM2NetEase // @namespace https://gf.qytechs.cn/zh-CN/scripts/11674-doubanfm2netease // @version 0.31 // @description doubanFM searching in netease cloud music // @author xavier skip // @match *://douban.fm/* // @grant none // @run-at document-load // ==/UserScript== function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } function NetEase(){ //不知道为什么豆瓣存储的信息song.artist和song.album总是一样的 return{ check: function(){ var e = document.querySelector('.send-song-to-phone'); this.version = e?1:2; return this.version; }, v1: function(){ var info = JSON.parse(window.localStorage.getItem('bubbler_song_info')); return { song: info.song_name, album: info.album, artist: info.artist }; }, v2: function(){ var info = JSON.parse(window.localStorage.getItem('simpleStorage'))['douradio-player-state'].current_song; return { song: info.title, album: info.albumtitle , artist: info.artist }; }, search: function(){ var v = this.check(); var info; if ( v == 1 ) { info = this.v1(); }else{ info = this.v2(); } return this.search_url(info); }, search_url: function(info){ var keywords; if(info.song.length>30){ keywords = info.song; }else if( (info.song.length + info.album.length)>40){ keywords = [info.song, info.album].join(' '); }else{ keywords = [info.song, info.album, info.artist].join(' '); } return "http://music.163.com/#/search/m/?s="+encodeURIComponent(keywords); }, get_element :function(){ var that = this; var a = document.createElement('a'); a.id = "netease"; a.target="_blank"; a.innerText = "在网易云音乐中查找当前播放歌曲"; a.href = this.search(); a.addEventListener("click",function(e){ a.href = that.search(); console.log('a click'); e.stopImmediatePropagation(); }, true); return a; }, element: function(){ var div = document.createElement('div'); var p = document.createElement('p'); p.appendChild(this.get_element()); div.appendChild(p); return div; } }; } // init var insert_queryname = '.sub-buttons-wrapper'; var content = document.querySelector(insert_queryname); var netease = new NetEase(); var again = function(){ content = document.querySelector(insert_queryname); if(content){ content.appendChild(netease.element()); console.log('doubanFM2NetEase insert', content); }else{ setTimeout(again, 700); } }; console.log('doubanFM2NetEase init'); // main if(content){ setTimeout(again, 700); }else{ again(); } // set css addGlobalStyle('#netease{color:#888;z-index:9999;}#netease:hover{background:0;color:#5b9;}');
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址