Remove Google Analytics and Update Dependencies

This commit is contained in:
Leo
2022-04-25 20:46:57 +00:00
committed by GitHub
parent 7a9aa3bb10
commit 2c728a61c2
4 changed files with 32 additions and 81 deletions

View File

@@ -1,7 +1,7 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (process){(function (){ (function (process){(function (){
/** /**
* @popperjs/core v2.11.4 - MIT License * @popperjs/core v2.11.5 - MIT License
*/ */
'use strict'; 'use strict';
@@ -7967,9 +7967,9 @@ var BitField = /** @class */ (function () {
var j = i >> 3; var j = i >> 3;
if (value) { if (value) {
if (this.buffer.length < j + 1) { if (this.buffer.length < j + 1) {
var length_1 = Math.max(j + 1, Math.min(2 * this.buffer.length, this.grow)); var length = Math.max(j + 1, Math.min(2 * this.buffer.length, this.grow));
if (length_1 <= this.grow) { if (length <= this.grow) {
var newBuffer = new Uint8Array(length_1); var newBuffer = new Uint8Array(length);
newBuffer.set(this.buffer); newBuffer.set(this.buffer);
this.buffer = newBuffer; this.buffer = newBuffer;
} }
@@ -8395,10 +8395,13 @@ class Wire extends stream.Duplex {
if (this.hasFast) { if (this.hasFast) {
// BEP6: If a peer sends a choke, it MUST reject all requests from the peer to whom the choke // BEP6: If a peer sends a choke, it MUST reject all requests from the peer to whom the choke
// was sent except it SHOULD NOT reject requests for pieces that are in the allowed fast set. // was sent except it SHOULD NOT reject requests for pieces that are in the allowed fast set.
while (this.peerRequests.length) { let allowedCount = 0
const request = this.peerRequests[0] while (this.peerRequests.length > allowedCount) { // until only allowed requests are left
if (!this.allowedFastSet.includes(request.piece)) { const request = this.peerRequests[allowedCount] // first non-allowed request
this.reject(request.piece, request.offset, request.length) if (this.allowedFastSet.includes(request.piece)) {
++allowedCount // count request as allowed
} else {
this.reject(request.piece, request.offset, request.length) // removes from this.peerRequests
} }
} }
} else { } else {
@@ -13107,6 +13110,7 @@ class WebSocketTracker extends Tracker {
clearTimeout(peer.trackerTimeout) clearTimeout(peer.trackerTimeout)
peer.trackerTimeout = null peer.trackerTimeout = null
delete this.peers[offerId] delete this.peers[offerId]
peer.destroy()
} else { } else {
debug(`got unexpected answer: ${JSON.stringify(data.answer)}`) debug(`got unexpected answer: ${JSON.stringify(data.answer)}`)
} }
@@ -59372,7 +59376,7 @@ class WebTorrent extends EventEmitter {
} }
port.postMessage(chunk) port.postMessage(chunk)
if (!chunk) cleanup() if (!chunk) cleanup()
if (!this.workerKeepAliveInterval) this.workerKeepAliveInterval = setInterval(() => fetch(`${this.serviceWorker.scriptURL.substr(0, this.serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)}webtorrent/keepalive/`), keepAliveTime) if (!this.workerKeepAliveInterval) this.workerKeepAliveInterval = setInterval(() => fetch(`${this.serviceWorker.scriptURL.slice(0, this.serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)}webtorrent/keepalive/`), keepAliveTime)
} else { } else {
cleanup() cleanup()
} }
@@ -60040,7 +60044,7 @@ class File extends EventEmitter {
if (typeof window === 'undefined') throw new Error('browser-only method') if (typeof window === 'undefined') throw new Error('browser-only method')
if (!this._serviceWorker) throw new Error('No worker registered') if (!this._serviceWorker) throw new Error('No worker registered')
if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated') if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated')
const workerPath = this._serviceWorker.scriptURL.substr(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length) const workerPath = this._serviceWorker.scriptURL.slice(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)
const url = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}` const url = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`
cb(null, url) cb(null, url)
} }
@@ -60049,7 +60053,7 @@ class File extends EventEmitter {
if (typeof window === 'undefined') throw new Error('browser-only method') if (typeof window === 'undefined') throw new Error('browser-only method')
if (!this._serviceWorker) throw new Error('No worker registered') if (!this._serviceWorker) throw new Error('No worker registered')
if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated') if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated')
const workerPath = this._serviceWorker.scriptURL.substr(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length) const workerPath = this._serviceWorker.scriptURL.slice(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)
elem.src = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}` elem.src = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`
cb(null, elem) cb(null, elem)
} }
@@ -61104,14 +61108,6 @@ class Torrent extends EventEmitter {
this.bitfield = new BitField(this.pieces.length) this.bitfield = new BitField(this.pieces.length)
this.wires.forEach(wire => {
// If we didn't have the metadata at the time ut_metadata was initialized for this
// wire, we still want to make it available to the peer in case they request it.
if (wire.ut_metadata) wire.ut_metadata.setMetadata(this.metadata)
this._onWireWithMetadata(wire)
})
// Emit 'metadata' before 'ready' and 'done' // Emit 'metadata' before 'ready' and 'done'
this.emit('metadata') this.emit('metadata')
@@ -61265,6 +61261,15 @@ class Torrent extends EventEmitter {
// In case any selections were made before torrent was ready // In case any selections were made before torrent was ready
this._updateSelections() this._updateSelections()
// Start requesting pieces after we have initially verified them
this.wires.forEach(wire => {
// If we didn't have the metadata at the time ut_metadata was initialized for this
// wire, we still want to make it available to the peer in case they request it.
if (wire.ut_metadata) wire.ut_metadata.setMetadata(this.metadata)
this._onWireWithMetadata(wire)
})
} }
destroy (opts, cb) { destroy (opts, cb) {
@@ -61684,7 +61689,7 @@ class Torrent extends EventEmitter {
// More info: https://github.com/webtorrent/bittorrent-protocol#extension-api // More info: https://github.com/webtorrent/bittorrent-protocol#extension-api
this.emit('wire', wire, addr) this.emit('wire', wire, addr)
if (this.metadata) { if (this.ready) {
queueMicrotask(() => { queueMicrotask(() => {
// This allows wire.handshake() to be called (by Peer.onHandshake) before any // This allows wire.handshake() to be called (by Peer.onHandshake) before any
// messages get sent on the wire // messages get sent on the wire
@@ -62632,7 +62637,7 @@ class WebConn extends Wire {
const fileEnd = requestedFile.offset + requestedFile.length - 1 const fileEnd = requestedFile.offset + requestedFile.length - 1
const url = this.url + const url = this.url +
(this.url[this.url.length - 1] === '/' ? '' : '/') + (this.url[this.url.length - 1] === '/' ? '' : '/') +
requestedFile.path requestedFile.path.replace(this._torrent.path, '')
return { return {
url, url,
fileOffsetInRange: Math.max(requestedFile.offset - rangeStart, 0), fileOffsetInRange: Math.max(requestedFile.offset - rangeStart, 0),
@@ -62749,7 +62754,7 @@ module.exports = WebConn
}).call(this)}).call(this,require("buffer").Buffer) }).call(this)}).call(this,require("buffer").Buffer)
},{"../package.json":494,"bitfield":26,"bittorrent-protocol":27,"buffer":109,"debug":160,"lt_donthave":255,"simple-get":393,"simple-sha1":410}],494:[function(require,module,exports){ },{"../package.json":494,"bitfield":26,"bittorrent-protocol":27,"buffer":109,"debug":160,"lt_donthave":255,"simple-get":393,"simple-sha1":410}],494:[function(require,module,exports){
module.exports={ module.exports={
"version": "1.8.6" "version": "1.8.14"
} }
},{}],495:[function(require,module,exports){ },{}],495:[function(require,module,exports){
// Returns a wrapper function that returns a wrapped callback // Returns a wrapper function that returns a wrapped callback
@@ -62962,10 +62967,6 @@ function start() {
copyurl.on('success', function(e) { copyurl.on('success', function(e) {
notyf.success('Copied site URL to clipboard!'); notyf.success('Copied site URL to clipboard!');
console.info(e); console.info(e);
gtag('event', 'share', {
"method": "Copy URL",
"content_id": e.text,
});
}); });
copyurl.on('failure', function(e) { copyurl.on('failure', function(e) {
notyf.error('Problem copying to clipboard'); notyf.error('Problem copying to clipboard');
@@ -62975,10 +62976,6 @@ function start() {
let copymagnet = new clipboard('#copyMagnet'); let copymagnet = new clipboard('#copyMagnet');
copymagnet.on('success', function(e) { copymagnet.on('success', function(e) {
notyf.success('Copied Magnet URL to clipboard!'); notyf.success('Copied Magnet URL to clipboard!');
gtag('event', 'share', {
"method": "Copy Magnet",
"content_id": e.text,
});
}); });
copymagnet.on('failure', function(e) { copymagnet.on('failure', function(e) {
notyf.error('Problem copying to clipboard'); notyf.error('Problem copying to clipboard');
@@ -63168,14 +63165,6 @@ function display() {
sourceTooltip.enable(); sourceTooltip.enable();
gtag('event', 'view_item', {
items: [{
"item_id": parsed.infoHash,
"item_name": parsed.name,
"item_category": source
}]
});
} }
function createFileRow(icon, name, size) { function createFileRow(icon, name, size) {
@@ -63262,7 +63251,6 @@ function resetProperties() {
copyMagnet.setAttribute('data-clipboard-text', ''); copyMagnet.setAttribute('data-clipboard-text', '');
document.title = 'Torrent Parts | Inspect and edit what\'s in your Torrent file or Magnet link'; document.title = 'Torrent Parts | Inspect and edit what\'s in your Torrent file or Magnet link';
sourceTooltip.disable(); sourceTooltip.disable();
gtag('event', 'reset');
} }
async function addCurrentTrackers() { async function addCurrentTrackers() {
@@ -63285,7 +63273,6 @@ async function addCurrentTrackers() {
addTrackers.className = ''; addTrackers.className = '';
addTrackers.innerHTML = 'Add Known Working Trackers'; addTrackers.innerHTML = 'Add Known Working Trackers';
display(); display();
gtag('event', 'add_trackers');
} }
function addRow() { function addRow() {
@@ -63336,7 +63323,6 @@ function getFilesFromPeers() {
torrent.destroy(); torrent.destroy();
}); });
display(); display();
gtag('event', 'attempt_webtorrent_fetch');
} }
// https://stackoverflow.com/a/36899900/2700296 // https://stackoverflow.com/a/36899900/2700296
@@ -63353,10 +63339,6 @@ function saveTorrent() {
a.click(); a.click();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
a.remove(); a.remove();
gtag('event', 'share', {
"method": "Torrent Download",
"content_id": parsed.name
});
} }
}).call(this)}).call(this,require("buffer").Buffer) }).call(this)}).call(this,require("buffer").Buffer)
},{"buffer":109,"bytes":115,"clipboard":134,"mime-types":279,"parse-torrent":331,"tippy.js":474,"webtorrent":487}]},{},[497]); },{"buffer":109,"bytes":115,"clipboard":134,"mime-types":279,"parse-torrent":331,"tippy.js":474,"webtorrent":487}]},{},[497]);

4
bin/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -43,14 +43,6 @@
<script async defer src="https://buttons.github.io/buttons.js"></script> <script async defer src="https://buttons.github.io/buttons.js"></script>
<script src="/ext/notyf.min.js"></script> <script src="/ext/notyf.min.js"></script>
<script async defer src="https://www.googletagmanager.com/gtag/js?id=G-VT4953Z89H"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VT4953Z89H');
</script>
<script async defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "6f97f49b4c384ee197a2f319cebec274"}'></script> <script async defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "6f97f49b4c384ee197a2f319cebec274"}'></script>
</head> </head>

View File

@@ -151,10 +151,6 @@ function start() {
copyurl.on('success', function(e) { copyurl.on('success', function(e) {
notyf.success('Copied site URL to clipboard!'); notyf.success('Copied site URL to clipboard!');
console.info(e); console.info(e);
gtag('event', 'share', {
"method": "Copy URL",
"content_id": e.text,
});
}); });
copyurl.on('failure', function(e) { copyurl.on('failure', function(e) {
notyf.error('Problem copying to clipboard'); notyf.error('Problem copying to clipboard');
@@ -164,10 +160,6 @@ function start() {
let copymagnet = new clipboard('#copyMagnet'); let copymagnet = new clipboard('#copyMagnet');
copymagnet.on('success', function(e) { copymagnet.on('success', function(e) {
notyf.success('Copied Magnet URL to clipboard!'); notyf.success('Copied Magnet URL to clipboard!');
gtag('event', 'share', {
"method": "Copy Magnet",
"content_id": e.text,
});
}); });
copymagnet.on('failure', function(e) { copymagnet.on('failure', function(e) {
notyf.error('Problem copying to clipboard'); notyf.error('Problem copying to clipboard');
@@ -357,14 +349,6 @@ function display() {
sourceTooltip.enable(); sourceTooltip.enable();
gtag('event', 'view_item', {
items: [{
"item_id": parsed.infoHash,
"item_name": parsed.name,
"item_category": source
}]
});
} }
function createFileRow(icon, name, size) { function createFileRow(icon, name, size) {
@@ -451,7 +435,6 @@ function resetProperties() {
copyMagnet.setAttribute('data-clipboard-text', ''); copyMagnet.setAttribute('data-clipboard-text', '');
document.title = 'Torrent Parts | Inspect and edit what\'s in your Torrent file or Magnet link'; document.title = 'Torrent Parts | Inspect and edit what\'s in your Torrent file or Magnet link';
sourceTooltip.disable(); sourceTooltip.disable();
gtag('event', 'reset');
} }
async function addCurrentTrackers() { async function addCurrentTrackers() {
@@ -474,7 +457,6 @@ async function addCurrentTrackers() {
addTrackers.className = ''; addTrackers.className = '';
addTrackers.innerHTML = 'Add Known Working Trackers'; addTrackers.innerHTML = 'Add Known Working Trackers';
display(); display();
gtag('event', 'add_trackers');
} }
function addRow() { function addRow() {
@@ -525,7 +507,6 @@ function getFilesFromPeers() {
torrent.destroy(); torrent.destroy();
}); });
display(); display();
gtag('event', 'attempt_webtorrent_fetch');
} }
// https://stackoverflow.com/a/36899900/2700296 // https://stackoverflow.com/a/36899900/2700296
@@ -542,8 +523,4 @@ function saveTorrent() {
a.click(); a.click();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
a.remove(); a.remove();
gtag('event', 'share', {
"method": "Torrent Download",
"content_id": parsed.name
});
} }