问题描述
Ihavetroublewithjavascripthttps://chrome.google.com/extensions/detail/bamkbfdmckphehgiafpenehgebjgdlliIwantadd:wmp_p.settings.setMode("loop",True);butnoeffect,howtouse?
解决方案
解决方案二:
(function(){varpage_links=document.links;for(vari=0;i<page_links.length;i++){if(page_links[i].href.match(/(wmv$)|(mpg$)|(wav$)|(mkv$)|(mp4$)|(avi$)|(mpeg$)|(mlv$)|(mpe$)|(asf$)|(flv$)|(mp3$)|(flv$)|(wma$)|(ogg$)|(oga$)|(ogv$)|(aac$)/i)){varspan=document.createElement("span");vartoggle=document.createElement("a");toggle.title="togPlay"+i;toggle.innerHTML="<imgsrc='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGsSURBVDiNpZM/SyNBGMafmdsdljWXRq4QJaIHZkVsDItR7kMogoK94hUWV1x39V1xjSjBQg4/gfgZJI0QUttaBPHiJdlsloWZzLtjIRuzmHABB95i/ry/eZ73nWHGGLxnsK39/S8Afn/M5cr5fH6ipDAM0YuiWwDfLQAnRwcHpQ3fxwfOJwJQkuC2ViufX1ycWI7jlLxiEX87HSRJMhGAcw7P8+C6bskSQiCIIgzXQiqFp8dHzBUKYyExY3AcB5yIoLUGEQ2iLyXOKhVcX10h6vUye2mkORYAaK0zdK01pJS4qVZRq9exs72NldVVMMbeKLGMMSMBSikAgFIKfy4v4RWL2NvdRW6oU8aYFwVElK0yEaSUg7kQApu+j9mZGbTDMKtgnIVUwbrv4+vhIWKl0Gy3M+eMMaMtEBGmXBffjo/xeWkJrSB4432ggDEGrXWmQMK2UTk9xb8gwFOrNTIxbbtl2za63S5c1wUfeokPzebYW5MkQRzHEELAWpyfv2s0GsujWvS/sVAo3Fn+2tpPIvrR6nQWZL8/oAzjXhdZatF8mp6+55z/Yu/9zs+e29iUS1YO2wAAAABJRU5ErkJggg%3D%3D'alt='Openvideoinlineplayer'title='Openvideoinlineplayer'>";toggle.style.cursor="pointer";toggle.style.border="none";varmp3_url=page_links[i].href;varautostart="false"varwidth=640varheight=480varplayer=document.getElementById("wmp_p");//player.settings.setMode("loop",true);embed_code='<embedstyle="FILTER:xray()"type="application/x-mplayer2"id="wmp_p"src="'+mp3_url+'"width="640"height="100"ShowControls="1"ShowStatusBar="1"ShowDisplay="1"autostart="false"loop="true"/>'span.innerHTML="<br/>"span.innerHTML+=embed_code;span.style.display="none";span.id="togPlay"+i;//toggle.innerHTML=span;toggle.addEventListener("click",togglePlayer,true);page_links[i].parentNode.insertBefore(span,page_links[i].nextSibling)page_links[i].parentNode.insertBefore(toggle,page_links[i].nextSibling)}}functiontogglePlayer(event){player=document.getElementById(this.title);if(player.style.display=="none"){player.style.display="inline";this.innerHTML="<imgsrc='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAHmSURBVDiNpZM9S1tRGMd/5+Tcm+RiQ1C6KnYxQkAwBKPtVPwADbUlKHQT+gW6dW6HLm4d3ApCaId8BJGSEglIwcG1Q5YOJU2MCTf3Oed2iObFFir4n87zPDz/l3M4Ko5j7gP1bHf3CfDhwdxcKZPJ3Gmp2+1y2es1gDcGOHi9v1/YLBZJaH0nAuscjWaz9PHw8MCkUqlCbmWFn+02zjkARAQAY8w/a601uVyOIAgKxvd9fvd63NyFiPC5WiWZTFIulwGo1WqEYcjLSmVM0leKVCqFsdaOFUSEL9Uq38/PR3UUAdA8OwPAWcuLKRJrLWbaohMhEiG6Xvx2ejqTPRLBiSBTPRPH8ZgAoFKp4BlDvdGYWX5cKvF8Zwd3LQQQx/HIgbV2ouIcYu3YxQ3EWsIoQt96qZkIsbXUajW+1uvcxvHJCSJCuVxGJRITB9MRPGOYz2YZDocAvNrbA+DT0REA89ksOpEgmopslFKICEoprLU83d4mHQQE6TT5tTUAgnSa/mDA5tYWgzAcqwMYz/PodDoEQYDWmksRihsbOOfoDwYArObzo9nVFcBo1u/j+z7m0dLSRavVWlVK/ZX7f1heXLwwxfX1d9bat7/a7eUwisYs03ST5ujke178cGHhh9b6vbrvd/4DZPfoqld/9XkAAAAASUVORK5CYII%3D'alt='Openvideoinlineplayer'title='Closevideoinlineplayer'>";//player.settings.setMode("loop",true);//player.settings.setMode("autoRewind",false);player.controls.play();}else{player.style.display="none";this.innerHTML="<imgsrc='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAADdgAAA3YBfdWCzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGsSURBVDiNpZM/SyNBGMafmdsdljWXRq4QJaIHZkVsDItR7kMogoK94hUWV1x39V1xjSjBQg4/gfgZJI0QUttaBPHiJdlsloWZzLtjIRuzmHABB95i/ry/eZ73nWHGGLxnsK39/S8Afn/M5cr5fH6ipDAM0YuiWwDfLQAnRwcHpQ3fxwfOJwJQkuC2ViufX1ycWI7jlLxiEX87HSRJMhGAcw7P8+C6bskSQiCIIgzXQiqFp8dHzBUKYyExY3AcB5yIoLUGEQ2iLyXOKhVcX10h6vUye2mkORYAaK0zdK01pJS4qVZRq9exs72NldVVMMbeKLGMMSMBSikAgFIKfy4v4RWL2NvdRW6oU8aYFwVElK0yEaSUg7kQApu+j9mZGbTDMKtgnIVUwbrv4+vhIWKl0Gy3M+eMMaMtEBGmXBffjo/xeWkJrSB4432ggDEGrXWmQMK2UTk9xb8gwFOrNTIxbbtl2za63S5c1wUfeokPzebYW5MkQRzHEELAWpyfv2s0GsujWvS/sVAo3Fn+2tpPIvrR6nQWZL8/oAzjXhdZatF8mp6+55z/Yu/9zs+e29iUS1YO2wAAAABJRU5ErkJggg%3D%3D'alt='Openvideoinlineplayer'title='Openvideoinlineplayer'>";player.controls.stop();}}})();
解决方案三:
上面是代码帮忙看看