Browse Source

replace getScript to ajax method by CSP update #354

twisterarmy
ghost 6 months ago
parent
commit
4f1b817869
  1. 15
      js/interface_home.js

15
js/interface_home.js

@ -344,7 +344,12 @@ function initWebTorrent() { @@ -344,7 +344,12 @@ function initWebTorrent() {
twister.torrentIds = $.localStorage.get('torrentIds');
WEBTORRENT_ANNOUNCE = $.Options.WebTorrentTrackers.val.split(/[ ,]+/)
$.getScript('js/webtorrent.min.js', function() {
jQuery.ajax({
crossDomain: true,
dataType: 'script',
url: 'js/webtorrent.min.js',
success: function() {
WebTorrentClient = new WebTorrent();
console.log("WebTorrent started")
WebTorrentClient.on('error', function (err) {
@ -354,7 +359,11 @@ function initWebTorrent() { @@ -354,7 +359,11 @@ function initWebTorrent() {
console.error('WARNING: ' + err.message);
});
$.getScript('js/localforage.min.js', function() {
jQuery.ajax({
crossDomain: true,
dataType: 'script',
url: 'js/localforage.min.js',
success: function() {
localforage.setDriver([localforage.INDEXEDDB,localforage.WEBSQL]).then(function() {
for (var torrentId in twister.torrentIds) {
if( twister.torrentIds[torrentId] ) {
@ -416,7 +425,9 @@ function initWebTorrent() { @@ -416,7 +425,9 @@ function initWebTorrent() {
}
});
});
}
});
}
});
}

Loading…
Cancel
Save