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:'開始',但我改變了一件事。
任何想法阻止頁面的其他腳本?