Compare commits

..

5 Commits

5 changed files with 44 additions and 4 deletions

View File

@ -12,7 +12,7 @@
#define GTK "gtk-application-prefer-dark-theme", false, "gtk-enable-animations", false #define GTK "gtk-application-prefer-dark-theme", false, "gtk-enable-animations", false
#define ROSE_HOMEPAGE false #define ROSE_HOMEPAGE false
#define SEARCH "https://search.nunosempere.com/search?q=%s" // "https://lite.duckduckgo.com/html/?q=%s" #define SEARCH "https://lite.duckduckgo.com/html/?q=%s" // "https://search.nunosempere.com/search?q=%s"
#define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/" #define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/"
// #define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/" // #define HOME ROSE_HOMEPAGE ? "file:///home/loki/Documents/core/software/fresh/C/rose-browser/rosenrot/user-scripts/ubuntu-20.04/rose-images/rose-homepage.png" : "https://search.nunosempere.com/"
#define CACHE_DIR "/home/loki/.cache/rose" #define CACHE_DIR "/home/loki/.cache/rose"

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 4709 + 100 #define STYLE_N 6073 + 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 4709 + 100 #define STYLE_N 6073 + 100
void read_style_js(char* string); void read_style_js(char* string);

View File

@ -78,7 +78,47 @@ if (document.domain == "twitter.com") {
[data-testid^="sidebarColumn"] { [data-testid^="sidebarColumn"] {
display: none; display: none;
} }
/* hide video */
[data-testid^="videoPlayer"] {
display: none !important;
}
[data-testid^="videoPlayer"]:before {
content: '[twitter video]';
}
`; `;
// Function to hide the grandparent of video players
function hideVideoPlayerGrandparent() {
document
.querySelectorAll('[data-testid="videoPlayer"]')
.forEach(function (videoPlayer) {
var grandparentElement = videoPlayer.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
var newTextElement = document.createElement('div');
newTextElement.textContent = '[twitter video]';
newTextElement.style.borderWidth = '0px !important';
grandparentElement.replaceWith(newTextElement);
});
}
// Create a new MutationObserver instance
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.addedNodes.length) {
hideVideoPlayerGrandparent(); // Call the function to hide video players
}
});
});
// Options for the observer (which mutations to observe)
var config = { childList: true, subtree: true };
// Start observing the target node for configured mutations
observer.observe(document.body, config);
// Call the function initially to hide any video players on initial load
hideVideoPlayerGrandparent();
} }
if (document.domain == "reddit.com" || document.domain == "old.reddit.com") { if (document.domain == "reddit.com" || document.domain == "old.reddit.com") {

BIN
rose

Binary file not shown.