Last active
July 11, 2017 19:54
-
-
Save jondcoleman/bafe6a42355efd869c3e9759fa377dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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