Google+タイトル表示変更
by
yutacar
2011-10-11 [2011/10/11 18:00:03]
Google+の通知をタイトルに「Google+ (X)」の形式で表示します。
@@ -14,7 +14,7 @@
if(d.innerHTML != " ") {
var title = document.title;
if (title.lastIndexOf("(") >= 0)
- title = title.substring(0,title.lastIndexOf("(") - 1);
+ title = title.substring(0,title.lastIndexOf("(") - 1) + title.substring(title.lastIndexOf(")") + 1, );
document.title = title + " (" + d.innerHTML + ")";
}
},1000);
/*
* @title Google+タイトル表示変更
* @description Google+の通知をタイトルに「Google+ (X)」の形式で表示します。
* @include https://plus.google.com/*
* @license MIT License
* @require jquery
*/
(function(d){
if(d.match("plus\.google\.com")){
// Notification
setInterval(function(){
var d = document.getElementById("gbi1");
if(d)
if(d.innerHTML != " ") {
var title = document.title;
if (title.lastIndexOf("(") >= 0)
title = title.substring(0,title.lastIndexOf("(") - 1) + title.substring(title.lastIndexOf(")") + 1, );
document.title = title + " (" + d.innerHTML + ")";
}
},1000);
}
})(document.domain);
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。