Skip to content

Commit c740569

Browse files
committed
added fix for youtube shaking video
1 parent 3a12afa commit c740569

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/sscr.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,20 @@ function init() {
144144
}
145145
}
146146

147+
// gmail performance fix
147148
if (document.URL.indexOf("mail.google.com") > -1) {
148149
var s = document.createElement("style");
149150
s.innerHTML = ".iu { visibility: hidden }";
150151
(document.getElementsByTagName("head")[0] || html).appendChild(s);
151152
}
153+
// youtube shaking video fix
154+
else if (document.URL.indexOf("http://www.youtube.com") === 0) {
155+
var player = document.getElementById("watch-player");
156+
var embed = player.getElementsByTagName("embed");
157+
embed[0].setAttribute("wmode", "opaque");
158+
player.innerHTML = player.innerHTML;
159+
}
160+
// disable fixed background
152161
if (!fixedback && !disabled) {
153162
body.style.backgroundAttachment = "scroll";
154163
html.style.backgroundAttachment = "scroll";
@@ -489,4 +498,4 @@ function pulse(x) {
489498

490499
addEvent("mousedown", mousedown);
491500
addEvent("mousewheel", wheel);
492-
addEvent("load", init);
501+
addEvent("load", init);

0 commit comments

Comments
 (0)