Last active
November 4, 2018 12:25
-
-
Save Romern/427a725a2da874bcfb1876c8a7d0f057 to your computer and use it in GitHub Desktop.
Telegram has a very stupid restricted layout. This userscript removes all width restrictions. Also works with rambox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Telegram - Full Sized Windows | |
// @namespace http://userstyles.org | |
// @description Telegram has a very stupid restricted layout. This removes all width restrictions | |
// @author Roman Karwacik | |
// @run-at document-idle | |
// @match https://web.telegram.org/* | |
// @version 1 | |
// ==/UserScript== | |
(function() { | |
var css = [".im_send_form {max-width: 10000px;}", | |
".tg_head_split {max-width: 10000px;}", | |
".im_page_wrap {max-width: 10000px;}", | |
".im_message_wrap {max-width: 10000px;}", | |
".im_send_panel_wrap {max-width: 10000px;}", | |
".im_history_col_wrap {width: 75%;}", | |
".im_dialogs_col_wrap {width: 25%;}", | |
".composer_emoji_tooltip{margin-left: -245px;}"]; | |
if (typeof GM_addStyle != "undefined") { | |
for (var i = 0; i<css.length; i++) { | |
GM_addStyle(css[i]); | |
} | |
} else if (typeof PRO_addStyle != "undefined") { | |
for (var i = 0; i<css.length; i++) { | |
PRO_addStyle(css[i]); | |
} | |
} else if (typeof addStyle != "undefined") { | |
for (var i = 0; i<css.length; i++) { | |
addStyle(css[i]); | |
} | |
} else { | |
var node = document.createElement("style"); | |
node.type = "text/css"; | |
for (var i = 0; i<css.length; i++) { | |
node.appendChild(document.createTextNode(css[i])); | |
} | |
var heads = document.getElementsByTagName("head"); | |
if (heads.length > 0) { | |
heads[0].appendChild(node); | |
} else { | |
// no head yet, stick it whereever | |
document.documentElement.appendChild(node); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment