Created
April 3, 2016 09:47
-
-
Save asm256/cb77c1ef3c926321268b9e0c6087f1d3 to your computer and use it in GitHub Desktop.
通知アラートをクリックすると艦これタブを開く
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
utils.jsm: open KancolleTab when notify click | |
通知アラートをクリックすると艦これタブを開く | |
diff --git a/chrome/content/utils.jsm b/chrome/content/utils.jsm | |
index 613336e..a8aa46f 100644 | |
--- a/chrome/content/utils.jsm | |
+++ b/chrome/content/utils.jsm | |
@@ -33,7 +33,20 @@ var KanColleTimerUtils = { | |
}, | |
}, | |
alert: { | |
+ _notify: { | |
+ observe: function(subject, topic, data) { | |
+ if(topic == "alertclickcallback"){ | |
+ if(!KanColleTimerUtils.window.selectTab(KanColleUtils.URL)) | |
+ KanColleTimerUtils.window.openTab(KanColleUtils.URL, true) | |
+ } | |
+ } | |
+ }, | |
show: function(imageURL, title, text, clickable, cookie, listener) { | |
+ // 通知をクリックすると艦これタブを開く | |
+ if(listener == null){ | |
+ clickable = true; | |
+ listener = this._notify; | |
+ } | |
try { | |
let alertserv = Cc['@mozilla.org/alerts-service;1'] | |
.getService(Ci.nsIAlertsService); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment