savepoint: add functionality to not show twitter videos

This commit is contained in:
NunoSempere 2023-11-08 23:24:06 +00:00
parent a7c1f8f57e
commit 0ba87b8cdc
3 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#define STYLE_N 5436 + 100 #define STYLE_N 6252 + 100
void read_style_js(char* string) void read_style_js(char* string)
{ {

View File

@ -1,7 +1,7 @@
#ifndef STYLE #ifndef STYLE
#define STYLE #define STYLE
#define STYLE_N 5436 + 100 #define STYLE_N 6252 + 100
void read_style_js(char* string); void read_style_js(char* string);

View File

@ -94,8 +94,14 @@ if (document.domain == "twitter.com") {
document document
.querySelectorAll('[data-testid="videoPlayer"]') .querySelectorAll('[data-testid="videoPlayer"]')
.forEach(function (videoPlayer) { .forEach(function (videoPlayer) {
var grandparentElement = videoPlayer.parentElement.parentElement; var grandparentElement = videoPlayer.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
grandparentElement.style.display = "none"; // grandparentElement.style.display = "none";
grandparentElement.innerHtml = "none";
// Make sure not to replace the content if it's already been replaced
if (grandparentElement.getAttribute('data-content-replaced') !== 'true') {
grandparentElement.textContent = ' [twitter video]';
grandparentElement.setAttribute('data-content-replaced', 'true');
}
}); });
} }