Skip to content

Instantly share code, notes, and snippets.

@jondcoleman
Last active July 11, 2017 19:54
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 jondcoleman/bafe6a42355efd869c3e9759fa377dae to your computer and use it in GitHub Desktop.
Save jondcoleman/bafe6a42355efd869c3e9759fa377dae to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name BetterSiteTitles
// @description Update with url base as title
// @include *://*.bosslm.com/*
// ==/UserScript==
(function() {
const siteBaseUrl = window.location.host.split('.')[0]
const newSiteName = siteBaseUrl.substr(0, 1).toUpperCase() + siteBaseUrl.substr(1)
document.title = newSiteName
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'https://' + window.location.host + '/ClientDocuments/Images/CompanyLogo.JPG';
document.getElementsByTagName('head')[0].appendChild(link);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment