Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lwcorp/91920cee06a205b56e90a32d262bb727 to your computer and use it in GitHub Desktop.
Save lwcorp/91920cee06a205b56e90a32d262bb727 to your computer and use it in GitHub Desktop.
Force LinkedIn to respect system (e.g. Dark) mode, and to minimize message overlay
javascript:function settheme(){document.cookie="li_theme=system; path=/; domain=."+location.hostname+"; secure; SameSite=None",dynamic&&document.documentElement.classList.toggle("theme--dark")}function minimizemsg(){var e,t="voyager-web:msg-overlay-state",i="_listBubble",o=localStorage.getItem(t);!o||(o=(e=JSON.parse(o))[0])&&o[i]&&(o[i].isMinimized=!0,localStorage.setItem(t,JSON.stringify(e))),dynamic&&(e="#msg-overlay>div",0<(e=document.querySelectorAll(e)).length&&((e=e[0]).classList.contains("msg-overlay-list-bubble--is-minimized")||e.querySelector("header>div:last-of-type>button:last-of-type").click()))}function%20limitdomain(){"linkedin.com"==location.hostname.replace("www.","")&&(settheme(),minimizemsg(),dynamic||location.reload())}var%20dynamic=!1;limitdomain();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment