Skip to content

Instantly share code, notes, and snippets.

@kohenkatz
Created May 16, 2019 01:44
Show Gist options
  • Save kohenkatz/7a5430365d6fc28fbf5b217657212826 to your computer and use it in GitHub Desktop.
Save kohenkatz/7a5430365d6fc28fbf5b217657212826 to your computer and use it in GitHub Desktop.
UserScript to widen the Site Switcher dropdown in the Ubiquiti Unifi Controller
// ==UserScript==
// @name Widen Unifi Site Switcher
// @namespace http://tampermonkey.net/
// @version 0.1
// @description The Unifi Site Switcher defaults to 200px. We want it wider!
// @author Moshe Katz
// @match https://your.unifi.controller.domain/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function addGlobalStyle(css) {
let head = document.getElementsByTagName('head')[0];
if (!head) { return; }
let style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('.appOrgSwitcher > .ubntPopover { width: 400px !important; }');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment