Skip to content

Instantly share code, notes, and snippets.

@anekos
Created December 27, 2009 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anekos/264288 to your computer and use it in GitHub Desktop.
Save anekos/264288 to your computer and use it in GitHub Desktop.
const stackPattern = /(zip-de-download|hoge)\.js/;
function popupAlert (iconPath, title, text, buttonEnabled, a, b) {
const ALERT_SVC =
Components.classes["@mozilla.org/alerts-service;1"].
getService(Components.interfaces.nsIAlertsService);
ALERT_SVC.showAlertNotification.apply(ALERT_SVC, arguments);
}
function simplePopupAlert (title, text) {
return popupAlert("", title, text, false, null, null);
}
let U = plugins.libly.$U;
U.around(
liberator,
'echo',
function (next, args) {
let [msg] = args;
try {
if (new Error('meow').stack.match(stackPattern))
simplePopupAlert('', msg);
} catch (e) {
liberator.log(e);
}
return next();
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment