0
我正在为Firefox做一个插件。我想从HTML页面提取视频并将其显示在黑色背景上。这是我得到的。阻止现有脚本
//main.js
var pageMod = require("page-mod");
pageMod.add(new pageMod.PageMod({
include: "http://myserver.fr/*",
contentStyleFile: data.url("modify.css"),
contentScriptFile: data.url('hack.js'),
contentScriptWhen: 'start'
}));
//hack.js
video = document.body.innerHTML;
document.body.innerHTML = '';
video = video.substring(video.lastIndexOf("<object"),video.lastIndexOf("</object>"));
video = "<div id='fond'></div><div id='mavideo'>"+video+"</div>"
document.body.innerHTML = video;
document.body.style.backgroundColor = "black";
document.body.style.margin = "0";
我的代码工作,但probleme是,我必须等待“时间”同时beeing执行其他JavaScript。我试图使用contentScriptWhen:'开始',但我改变了一件事。
任何想法阻止页面的其他脚本?