-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTwitter_-_Expand_video.user.js
More file actions
31 lines (29 loc) · 1.3 KB
/
Twitter_-_Expand_video.user.js
File metadata and controls
31 lines (29 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @name Twitter - Expand video
// @author Tailszefox
// @namespace localhost
// @description Ability to expand the current video on Twitter
// @include https://twitter.com/*/status/*
// @version 1.0
// @grant none
// @inject-into auto
// @run-at document-idle
// ==/UserScript==
window.setTimeout(function() {
console.log(document.querySelectorAll("video").length);
if ( document.querySelectorAll("video").length > 0)
{
var buttonSpan = document.createElement("span");
buttonSpan.style.cssText = "position: relative; top: 10px; cursor: pointer;";
var buttonText = document.createTextNode("Expand");
buttonSpan.append(buttonText);
document.querySelector(".permalink-tweet").appendChild(buttonSpan);
buttonSpan.addEventListener('click', function(e) {
document.querySelector("#permalink-overlay-dialog").style.cssText = "left: 0%; margin-left: 0px; width: 100%;";
document.querySelector(".permalink-container").style.width = "100%";
document.querySelector(".is-video").style.cssText = "max-width: none; max-height: 900px;";
document.querySelector(".AdaptiveMedia-video").style.cssText = "width: 100%;";
document.querySelector(".PlayableMedia-reactWrapper").style.cssText = "height: 900px;";
}, true);
}
}, 5000);