Created
December 27, 2009 14:33
-
-
Save anekos/264288 to your computer and use it in GitHub Desktop.
This file contains 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
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