add images and videos to the content replacer script for the bittorrent-as-cdn thing
This commit is contained in:
36
scrub.js
36
scrub.js
@@ -630,6 +630,24 @@ var coolheadersSetup = function(e) {
|
||||
};
|
||||
}
|
||||
}
|
||||
var videos = document.getElementsByTagName('video');
|
||||
for (let video of videos) {
|
||||
let tmpsrc = new URL(video.currentSrc);
|
||||
if (tmpsrc.host == location.host) {
|
||||
innerHTML = video.innerHTML;
|
||||
topInnerHTML = video.innerHTML.replace('src=\"', 'src=\"http://127.0.0.1:7657/i2psnark/' + location.host + '/');
|
||||
video.innerHTML = topInnerHTML + innerHTML;
|
||||
}
|
||||
}
|
||||
var audios = document.getElementsByTagName('audio');
|
||||
for (let audio of audios) {
|
||||
let tmpsrc = new URL(audio.currentSrc);
|
||||
if (tmpsrc.host == location.host) {
|
||||
innerHTML = audio.innerHTML;
|
||||
topInnerHTML = audio.innerHTML.replace('src=\"', 'src=\"http://127.0.0.1:7657/i2psnark/' + location.host + '/');
|
||||
audio.innerHTML = topInnerHTML + innerHTML;
|
||||
}
|
||||
}
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: 'torrent.html'
|
||||
@@ -653,6 +671,24 @@ var coolheadersSetup = function(e) {
|
||||
};
|
||||
}
|
||||
}
|
||||
var videos = document.getElementsByTagName('video');
|
||||
for (let video of videos) {
|
||||
let tmpsrc = new URL(video.currentSrc);
|
||||
if (tmpsrc.host == location.host) {
|
||||
innerHTML = video.innerHTML;
|
||||
topInnerHTML = video.innerHTML.replace('src=\"', 'src=\"http://127.0.0.1:7657/i2psnark/' + location.host + '/');
|
||||
video.innerHTML = topInnerHTML + innerHTML;
|
||||
}
|
||||
}
|
||||
var audios = document.getElementsByTagName('audio');
|
||||
for (let audio of audios) {
|
||||
let tmpsrc = new URL(audio.currentSrc);
|
||||
if (tmpsrc.host == location.host) {
|
||||
innerHTML = audio.innerHTML;
|
||||
topInnerHTML = audio.innerHTML.replace('src=\"', 'src=\"http://127.0.0.1:7657/i2psnark/' + location.host + '/');
|
||||
audio.innerHTML = topInnerHTML + innerHTML;
|
||||
}
|
||||
}
|
||||
browser.pageAction.setPopup({
|
||||
tabId: tabId.id,
|
||||
popup: 'torrent.html'
|
||||
|
||||
Reference in New Issue
Block a user