aboutsummaryrefslogtreecommitdiff
path: root/plugins/style/style.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/style/style.js')
-rw-r--r--plugins/style/style.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/style/style.js b/plugins/style/style.js
index 6af94ed..46bbc63 100644
--- a/plugins/style/style.js
+++ b/plugins/style/style.js
@@ -82,12 +82,26 @@ if (document.domain == "twitter.com") {
/* hide video */
[data-testid^="videoPlayer"] {
- display: none;
+ display: none !important;
}
[data-testid^="videoPlayer"]:before {
content: '[twitter video]';
}
`;
+
+ document.addEventListener('DOMContentLoaded', function() {
+ // Select all the videoPlayer elements
+ var videoPlayers = document.querySelectorAll('[data-testid="videoPlayer"]');
+
+ // Loop through the NodeList
+ videoPlayers.forEach(function(videoPlayer) {
+ // Traverse two levels up the DOM tree
+ var grandparentElement = videoPlayer.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
+
+ // Hide the grandparent element
+ grandparentElement.style.display = 'none';
+ });
+ });
}
if (document.domain == "reddit.com" || document.domain == "old.reddit.com") {