Created
February 3, 2015 04:51
-
-
Save AaronJWhite/e17e1fac0eef5f1aaba7 to your computer and use it in GitHub Desktop.
URL-In-Title IE crossrider code
This file contains hidden or 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
// This script is licensed under the MIT license. See | |
// http://opensource.org/licenses/mit-license.php for more details. | |
// ==UserScript== | |
// @name URL-in-Title | |
// @namespace http://www.aaronjwhite.org | |
// @description Adds page's URL to title bar. Works great with KeePass. | |
// @include * | |
appAPI.ready(function($) { | |
titleMod= (function(){ | |
var local = {}; | |
local.start = function(){ | |
addUrlToTitle(); | |
}; | |
function addUrlToTitle() | |
{ | |
var domainOnly= window.location.href.replace('http://', '').replace('https://', '').split('/').shift(); | |
if(document.title.length > 20) | |
{ | |
document.title = document.title.substr(0,19) + ' - ' + domainOnly; | |
} | |
else | |
{ | |
document.title = document.title + ' - ' + domainOnly; | |
} | |
} | |
return local; | |
}()); | |
titleMod.start(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment