mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2024-11-25 22:42:51 +01:00
Compare commits
No commits in common. "3cca16779350a981c36247e16289c88aab0ffcff" and "ad831d89e9c48fef1c1dc182d32401dc06c178f1" have entirely different histories.
3cca167793
...
ad831d89e9
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Discord History Tracker
|
// @name Discord History Tracker
|
||||||
// @version v.31d
|
// @version v.31c
|
||||||
// @license MIT
|
// @license MIT
|
||||||
// @namespace https://chylex.com
|
// @namespace https://chylex.com
|
||||||
// @homepageURL https://dht.chylex.com/
|
// @homepageURL https://dht.chylex.com/
|
||||||
@ -37,26 +37,16 @@ var DISCORD = (function(){
|
|||||||
return key ? ele[key] : null;
|
return key ? ele[key] : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
var tryGetReactProps = function(ele) {
|
|
||||||
try {
|
|
||||||
return this.getReactProps(ele);
|
|
||||||
} catch (ignore) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var getMessageElementProps = function(ele) {
|
var getMessageElementProps = function(ele) {
|
||||||
const props = getReactProps(ele);
|
const props = getReactProps(ele);
|
||||||
|
|
||||||
if (props.children && props.children.length) {
|
if (props.children && props.children.length >= 4) {
|
||||||
for (let i = 3; i < props.children.length; i++) {
|
const childProps = props.children[3].props;
|
||||||
const childProps = props.children[i].props;
|
|
||||||
|
|
||||||
if (childProps && "message" in childProps && "channel" in childProps) {
|
if ("message" in childProps && "channel" in childProps) {
|
||||||
return childProps;
|
return childProps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
@ -70,20 +60,16 @@ var DISCORD = (function(){
|
|||||||
const messages = [];
|
const messages = [];
|
||||||
|
|
||||||
for (const ele of getMessageElements()) {
|
for (const ele of getMessageElements()) {
|
||||||
try {
|
|
||||||
const props = getMessageElementProps(ele);
|
const props = getMessageElementProps(ele);
|
||||||
|
|
||||||
if (props != null) {
|
if (props != null) {
|
||||||
messages.push(props.message);
|
messages.push(props.message);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
console.error("[DHT] Error extracing message data, skipping it.", e, ele, tryGetReactProps(ele));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("[DHT] Error retrieving messages.", e);
|
console.error(e);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -651,7 +637,7 @@ ${radio("asm", "pause", "Pause Tracking")}
|
|||||||
${radio("asm", "switch", "Switch to Next Channel")}
|
${radio("asm", "switch", "Switch to Next Channel")}
|
||||||
<p id='dht-cfg-note'>
|
<p id='dht-cfg-note'>
|
||||||
It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br>
|
It is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.<br><br>
|
||||||
<sub>v.31d, released 19 June 2022</sub>
|
<sub>v.31c, released 19 May 2022</sub>
|
||||||
</p>`);
|
</p>`);
|
||||||
|
|
||||||
// elements
|
// elements
|
||||||
|
File diff suppressed because one or more lines are too long
4
build.py
4
build.py
@ -8,8 +8,8 @@ import os
|
|||||||
import re
|
import re
|
||||||
import distutils.dir_util
|
import distutils.dir_util
|
||||||
|
|
||||||
VERSION_SHORT = "v.31d"
|
VERSION_SHORT = "v.31c"
|
||||||
VERSION_FULL = VERSION_SHORT + ", released 19 June 2022"
|
VERSION_FULL = VERSION_SHORT + ", released 19 May 2022"
|
||||||
|
|
||||||
EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
EXEC_UGLIFYJS_WIN = "{2}/lib/uglifyjs.cmd --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
||||||
EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
EXEC_UGLIFYJS_AUTO = "uglifyjs --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""
|
||||||
|
@ -23,26 +23,16 @@ var DISCORD = (function(){
|
|||||||
return key ? ele[key] : null;
|
return key ? ele[key] : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
var tryGetReactProps = function(ele) {
|
|
||||||
try {
|
|
||||||
return this.getReactProps(ele);
|
|
||||||
} catch (ignore) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var getMessageElementProps = function(ele) {
|
var getMessageElementProps = function(ele) {
|
||||||
const props = getReactProps(ele);
|
const props = getReactProps(ele);
|
||||||
|
|
||||||
if (props.children && props.children.length) {
|
if (props.children && props.children.length >= 4) {
|
||||||
for (let i = 3; i < props.children.length; i++) {
|
const childProps = props.children[3].props;
|
||||||
const childProps = props.children[i].props;
|
|
||||||
|
|
||||||
if (childProps && "message" in childProps && "channel" in childProps) {
|
if ("message" in childProps && "channel" in childProps) {
|
||||||
return childProps;
|
return childProps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
@ -56,20 +46,16 @@ var DISCORD = (function(){
|
|||||||
const messages = [];
|
const messages = [];
|
||||||
|
|
||||||
for (const ele of getMessageElements()) {
|
for (const ele of getMessageElements()) {
|
||||||
try {
|
|
||||||
const props = getMessageElementProps(ele);
|
const props = getMessageElementProps(ele);
|
||||||
|
|
||||||
if (props != null) {
|
if (props != null) {
|
||||||
messages.push(props.message);
|
messages.push(props.message);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
console.error("[DHT] Error extracing message data, skipping it.", e, ele, tryGetReactProps(ele));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return messages;
|
return messages;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("[DHT] Error retrieving messages.", e);
|
console.error(e);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user