mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ded2d0ced | ||
|
|
314c793992 | ||
|
|
accc985e4b |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "2.1.4",
|
"version": "2.1.4.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ export async function openWarningChat(warningMessage: string): Promise<void> {
|
|||||||
const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
|
const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
|
||||||
const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : "";
|
const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : "";
|
||||||
const publicUserID = await utils.getHash(Config.config.userID);
|
const publicUserID = await utils.getHash(Config.config.userID);
|
||||||
|
const warningReasonMatch = warningMessage.match(/Warning reason: '(.+)'/);
|
||||||
|
|
||||||
openChat({
|
openChat({
|
||||||
displayName: `${userName ? `${userName} | `: ``}${userName !== publicUserID ? publicUserID : ``}`,
|
displayName: `${userName ? userName : ``}${userName !== publicUserID ? ` | ${publicUserID}` : ``}`,
|
||||||
composerInitialValue: `I got a warning and want to know what I need to do to improve.` +
|
composerInitialValue: `I got a warning and want to know what I need to do to improve.` +
|
||||||
`Warning reason: ${warningMessage.match(/Warning reason: '(.+)'/)[1]}`,
|
warningReasonMatch ? ` Warning reason: ${warningReasonMatch[1]}` : ``,
|
||||||
customDescription: chrome.i18n.getMessage("warningChatInfo")
|
customDescription: chrome.i18n.getMessage("warningChatInfo")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user