Skip to content

Instantly share code, notes, and snippets.

@q00u
Last active January 1, 2022 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save q00u/b1e23928a0b22df6eceff3d756ce6cae to your computer and use it in GitHub Desktop.
Save q00u/b1e23928a0b22df6eceff3d756ce6cae to your computer and use it in GitHub Desktop.
Hides GVoice Phone
// ==UserScript==
// @name GVoice Phone Hider
// @namespace https://gist.github.com/q00u
// @version 0.4
// @description Adds toggle button for the third (unnecessary) column in Google Voice, until they fix it
// @author Phoenix G
// @match https://voice.google.com/u/*
// @icon https://www.google.com/s2/favicons?domain=voice.google.com
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant GM_addStyle
// @grant GM_getResourceText
// ==/UserScript==
(function() {
'use strict';
const widthVal = $('gv-call-sidebar').width();
$('gmat-nav-list').append(' <gv-call-toggle [phone-open]="ctrl.obs_isCallSidebarVisible" (toggle)="ctrl.toggleCallSidebar()" label="Toggle phone" aria-label="Toggle phone"><button class="root mat-button" mat-button><span class="mat-button-wrapper"><div class="buttonContent"><mat-icon class="icon mat-icon notranslate mat-icon-no-color" role="img" svgicon="unfold_less" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"><path d="M20 15.08 16.92 12 20 8.92 18.59 7.5l-4.5 4.5 4.5 4.5zM4 8.92 7.08 12 4 15.08l1.41 1.42 4.5-4.5-4.5-4.5z"></path></svg></mat-icon></div></span></button></gv-call-toggle>');
$('gv-call-toggle').click(function() {
var toggleWidth = $('gv-call-sidebar').width() == widthVal ? '1px' : `${widthVal}px`;
$('gv-call-sidebar').animate({ width: toggleWidth });
});
})();
//Todo: Lots of cleanup, remember hide/show state
@q00u
Copy link
Author

q00u commented Jan 1, 2022

0.4: Properly attach the clicking action to 'gv-call-toggle', rather than the entire 'gmat-nav-list'

@q00u
Copy link
Author

q00u commented Jan 1, 2022

(Still no working tooltip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment