Skip to content

Instantly share code, notes, and snippets.

@marcelovani
Last active July 26, 2018 10:33
Show Gist options
  • Save marcelovani/3d432e412dfe8ea50c5589ed92c60a4f to your computer and use it in GitHub Desktop.
Save marcelovani/3d432e412dfe8ea50c5589ed92c60a4f to your computer and use it in GitHub Desktop.
Whatsapp tweaks
// ==UserScript==
// @name Whatsapp
// @namespace chat
// @version 0.1
// @description Tweaks
// @author Marcelo Vani
// @match https://web.whatsapp.com
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
})();
$(document).ready(function() {
refresh();
setInterval(refresh, 15000);
});
function refresh() {
//$( ".ghx-card-color-enabled" ).each(function() {
// var color = $( this ).find( ".ghx-grabber" ).css('backgroundColor');
// $( this ).css('background-color', easyColor(color));
//});
// Hide images on left sidebar.
$("[data-icon='default-group'], [data-icon='default-user']").parent().parent().css('display', 'none');
// Hide splash image
$("[data-asset-intro-image='true']").css('display', 'none');
// Chat colors
$(".tail-container, .copyable-text").parent().css('background-color', 'white');
// Fixes for sidebar.
//$("#side").parent().parent().find('div').css('-webkit-flex', 'none');
// Css fixes.
css();
}
function css() {
var style = document.createElement('style');
style.innerHTML =
'#side {' +
' width: 220px' +
'} ' +
'#side img {' +
' display: none' +
'} ' +
'span[data-icon="default-group"] {' +
' displau: none;' +
'} ' +
'span[data-icon="default-user"] {' +
' displau: none;' +
'} ' +
'#side header, #pane-side div, #side, #side div, #side label, #side input { ' +
' background: #8c2525!important;' +
' color: white;' +
' font-weight: 300;' +
' border: none;' +
'}' +
'#side header + div {' +
' display: none!important;' +
'}' +
'.copyable-text div, .copyable-text div div {' +
' background-color: white;' +
'}' +
'div#main div {' +
' background-color: white;' +
'}'
;
document.getElementsByTagName('head')[0].appendChild(style);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment