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