Zap la pub vidéo canalplus
当前为
// ==UserScript==
// @name Canal+ Player
// @description Zap la pub vidéo canalplus
// @namespace d19bfb8e-cacc-41f1-895b-9c2b5bd747be
// @author Reek
// @include *://www.canalplus.fr/*/pid*
// @version 1.0
// ==/UserScript==
if (parent == self) {
setTimeout(function () {
var lrefs = document.querySelectorAll('a[onclick]');
for (var j = 0, len = lrefs.length; j < len; ++j) {
var lref = lrefs[j];
if (lref.onclick.toString().search('loadVideoHistory') > -1) {
lref.removeAttribute('onclick');
lref.onclick = function () {
location.href = this.href;
};
}
}
var container = document.querySelector('#CanalPlayerEmbarque');
var parent = container.parentNode;
var videoId = unsafeWindow.videoId;
var player = document.createElement('div');
player.innerHTML = '<embed width="640px" height="360px" bgcolor="#000000" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" flashvars="param=cplus&env=prod&videoId=' + videoId + '&targetURL=&timecode=1&targetNewWindow=false&autoplay=1" name="canalPlayer" src="http://player.canalplus.fr/site/flash/player.swf"><noembed>Veuillez installer Flash Player pour lire la vid&eacute;o</noembed></object>';
parent.replaceChild(player, container);
}, 5000);
}