Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Closes #525 GM_notification now works on Fennec

  • Loading branch information...
commit 1bde7cd51d2a19eae3b231aead6bda5c1a653963 1 parent c3fc1cc
@erikvold erikvold authored
View
5 extension/content/e10s/browser.js
@@ -8,6 +8,7 @@
lazyImport(this, "resource://scriptish/api/GM_Resources.js", ["GM_Resources"]);
lazyUtil(global, "installUri");
+ lazyUtil(this, "notification");
var $ = function(id) document.getElementById(id);
@@ -81,6 +82,10 @@
return rtnAry;
});
+ mm.addMessageListener("Scriptish:ScriptNotification", function({json}) {
+ Scriptish_notification.apply(null, json);
+ });
+
mm.loadFrameScript(
"chrome://scriptish/content/e10s/browser-content.js",
true); // no delay loading frame script
View
16 extension/modules/api.js
@@ -96,10 +96,18 @@ function GM_API(options) {
if (!GM_apiLeakCheck("GM_notification")) return;
if (typeof aTitle != "string") aTitle = aScript.name;
if (typeof aIcon != "string") aIcon = aScript.iconURL;
- var callback = null;
- if (typeof aCallback == "function")
- callback = function() GM_apiSafeCallback(aSafeWin, aScript, null, aCallback);
- Scriptish_notification(aMsg, aTitle, aIcon, callback);
+
+
+ if (options.global && options.global.sendAsyncMessage) {
+ options.global.sendAsyncMessage("Scriptish:ScriptNotification", [
+ aMsg, aTitle, aIcon]);
+ }
+ else {
+ var callback = null;
+ if (typeof aCallback == "function")
+ callback = function() GM_apiSafeCallback(aSafeWin, aScript, null, aCallback);
+ Scriptish_notification(aMsg, aTitle, aIcon, callback);
+ }
}
this.GM_setValue = function GM_setValue() {
View
3  extension/modules/utils/Scriptish_notification.js
@@ -5,8 +5,7 @@ lazyImport(this, "resource://scriptish/logging.js", ["Scriptish_log"]);
function showAlertNotification() {
if ("Fennec" == Services.appinfo.name) {
- return showAlertNotification =
- Cc["@mozilla.org/toaster-alerts-service;1"]
+ return Cc["@mozilla.org/toaster-alerts-service;1"]
.getService(Ci.nsIAlertsService)
.showAlertNotification;
}
Please sign in to comment.
Something went wrong with that request. Please try again.