Skip to content

Instantly share code, notes, and snippets.

@gmelikov
Created July 24, 2020 14:25
Show Gist options
  • Save gmelikov/85b8fdb1325f4b869d958b2a3e29e408 to your computer and use it in GitHub Desktop.
Save gmelikov/85b8fdb1325f4b869d958b2a3e29e408 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Fix Webogram width
// @namespace webogram.fixes
// @match https://web.telegram.org/*
// @version 2
// @grant none
// ==/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);
}
// Upper Box, blue bar
addGlobalStyle('div.tg_head_split { max-width: calc(100% - 50px) !important; }');
// The contacts bar
addGlobalStyle('div.im_page_wrap { max-width: calc(100% - 50px) !important; }');
// Chat messages
addGlobalStyle('div.im_message_wrap { max-width: calc(100% - 100px) !important; }');
// The "<friend> is typing..." line
addGlobalStyle('div.im_history_typing { max-width: 100% !important; }');
// The box below the messages, the "send panel"
addGlobalStyle('div.im_send_panel_wrap { max-width: calc(100% - 115px) !important; }');
// The contents of the send panel between the avatars
addGlobalStyle('form.im_send_form { max-width: 100% !important; }');
//mine: sticker full size
addGlobalStyle('.im_message_media img, .im_message_media .clickable, .im_message_photo_thumb { width: auto !important; height: auto !important; }');
addGlobalStyle('.composer_sticker_image, .inline_result_sticker a, .inline_result_sticker_image img {width:192px !important; height:192px !important; max-width: 192px !important; max-height: 192px !important;}');
addGlobalStyle('.scroller_scrollable_container {height: 500px !important;}');
addGlobalStyle('.composer_dropdown_wrap {margin-top: -300px;}');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment