Skip to content

Instantly share code, notes, and snippets.

@ZhangYiJiang
Last active November 1, 2015 07:57
Show Gist options
  • Save ZhangYiJiang/e142b1fe2c3da5413939 to your computer and use it in GitHub Desktop.
Save ZhangYiJiang/e142b1fe2c3da5413939 to your computer and use it in GitHub Desktop.
Stack Exchange Title Tag Remover
// ==UserScript==
// @name Stack Exchange Title Tag Remover
// @namespace yijiang
// @include http://stackoverflow.com/questions/*
// @include http://superuser.com/questions/*
// @include http://serverfault.com/questions/*
// @include http://askubuntu.com/questions/*
// @include http://answers.onstartups.com/questions/*
// @include http://nothingtoinstall.com/questions/*
// @include http://seasonedadvice.com/questions/*
// @include http://crossvalidated.com/questions/*
// @include http://stackapps.com/questions/*
// @include http://*.stackexchange.com/questions/*
// @include https://stackoverflow.com/questions/*
// @include https://superuser.com/questions/*
// @include https://serverfault.com/questions/*
// @include https://askubuntu.com/questions/*
// @include https://answers.onstartups.com/questions/*
// @include https://nothingtoinstall.com/questions/*
// @include https://seasonedadvice.com/questions/*
// @include https://crossvalidated.com/questions/*
// @include https://stackapps.com/questions/*
// @include https://*.stackexchange.com/questions/*
// ==/UserScript==
if(!isNaN(parseInt(window.location.pathname.split('/')[2]), 10)){
var title = document.getElementsByTagName('h1')[0];
title = title.innerText || title.textContent;
document.title = title + document.title.substring(document.title.lastIndexOf('-') - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment