1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2024-10-18 02:42:53 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
a20ce8ee71
Release v.31e 2022-10-10 13:15:46 +02:00
b5ae561da2
Fix server name detection after a Discord update
References #204
2022-10-10 13:11:36 +02:00
6 changed files with 37 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Discord History Tracker
// @version v.31d
// @version v.31e
// @license MIT
// @namespace https://chylex.com
// @homepageURL https://dht.chylex.com/
@ -228,8 +228,21 @@ var DISCORD = (function(){
};
}
else if (obj.guild_id) {
let guild;
for (const child of getReactProps(document.querySelector("nav header [class*='headerContent-']")).children) {
if (child && child.props && child.props.guild) {
guild = child.props.guild;
break;
}
}
if (!guild || typeof guild.name !== "string" || obj.guild_id !== guild.id) {
return null;
}
return {
"server": document.querySelector("nav header h1[class*='name-']").innerText,
"server": guild.name,
"channel": obj.name,
"id": obj.id,
"type": "SERVER",
@ -651,7 +664,7 @@ ${radio("asm", "pause", "Pause Tracking")}
${radio("asm", "switch", "Switch to Next Channel")}
<p id='dht-cfg-note'>
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.31e, released 10 October 2022</sub>
</p>`);
// elements

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,8 @@ import os
import re
import distutils.dir_util
VERSION_SHORT = "v.31d"
VERSION_FULL = VERSION_SHORT + ", released 19 June 2022"
VERSION_SHORT = "v.31e"
VERSION_FULL = VERSION_SHORT + ", released 10 October 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_AUTO = "uglifyjs --parse bare_returns --compress --mangle toplevel --mangle-props keep_quoted,reserved=[{3}] --output \"{1}\" \"{0}\""

View File

@ -71,3 +71,4 @@ msSaveBlob
messageReference
message_id
guild_id
guild

View File

@ -214,8 +214,21 @@ var DISCORD = (function(){
};
}
else if (obj.guild_id) {
let guild;
for (const child of getReactProps(document.querySelector("nav header [class*='headerContent-']")).children) {
if (child && child.props && child.props.guild) {
guild = child.props.guild;
break;
}
}
if (!guild || typeof guild.name !== "string" || obj.guild_id !== guild.id) {
return null;
}
return {
"server": document.querySelector("nav header h1[class*='name-']").innerText,
"server": guild.name,
"channel": obj.name,
"id": obj.id,
"type": "SERVER",