Yves_W / CompOWRedditFix

// ==UserScript==
// @name           CompOWRedditFix
// @namespace      yveswscripts
// @description    Moves the comment expand button and it removes the (buggy) upvote effect. Also changes some padding and it fixes horizontal scrolling in Firefox.
// @author         Yves W
// @version        0.1.2.1
// @copyright      2016+, Yves W (openuserjs.org/users/Yves_W)
// @license      MIT
// @homepageURL    https://openuserjs.org/scripts/Yves_W/CompOWRedditFix
// @supportURL     https://github.com/YvesW
// @updateURL      https://openuserjs.org/meta/Yves_W/CompOWRedditFix.meta.js
// @downloadURL    https://openuserjs.org/install/Yves_W/CompOWRedditFix.user.js
// @include        *www.reddit.com/r/Competitiveoverwatch*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @run-at         document-start
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}


window.addEventListener('DOMContentLoaded', function(e) {
    
addGlobalStyle('.arrow.upmod:focus:after { animation:upvote 0s ease-out forwards !important; -webkit-animation:upvote 0s ease-out forwards !important; }');
addGlobalStyle('.arrow.up { background-position:-0px -78px !important; }');
addGlobalStyle('body.listing-page>.content,body.other-discussions-page>.content,.comments-page .link,.commentarea>.sitetable>.comment,#images,.combined-search-page>.content,.stylesheet-customize-container .pretty-form,.side .sidecontentbox,.account-activity-box,.side .titlebox,#previoussearch #moresearchinfo,#ad-frame,.wiki-page .wiki-page-content,.linefield,.submit-page .roundfield,.login-form-side { padding: 10px 8px 10px 5px !important; }');
addGlobalStyle('.comment .expand { border-radius:0 0 0 0 !important; padding:1px !important; position:relative !important; }');
addGlobalStyle('html, body { max-width: 100% !important; overflow-x: hidden !important; }');
    
    window.removeEventListener(e.type, arguments.callee, true);
}, true);

//window.addEventListener('load', function() {

//}, false);