1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:17:59 +01:00

add liberator.dump() to prefix dump() messages with our extension name

This commit is contained in:
Doug Kearns
2008-09-08 04:41:23 +00:00
parent b9f71d1bd9
commit f12f956e41
6 changed files with 25 additions and 19 deletions

View File

@@ -564,7 +564,7 @@ const liberator = (function () //{{{
triggerCallback: function (type, mode, data)
{
//dump("type: " + type + " mode: " + mode + "data: " + data + "\n");
//liberator.dump("type: " + type + " mode: " + mode + "data: " + data + "\n");
for (let i = 0; i < callbacks.length; i++)
{
var [thistype, thismode, thisfunc] = callbacks[i];
@@ -602,6 +602,12 @@ const liberator = (function () //{{{
return false; // so you can do: if (...) return liberator.beep();
},
// NOTE: "browser.dom.window.dump.enabled" preference needs to be set
dump: function (message)
{
dump(liberator.config.name.toLowerCase() + ": " + message);
},
// with (liberator) means, liberator is the default namespace "inside" eval
eval: function (str)
{
@@ -782,7 +788,7 @@ const liberator = (function () //{{{
if (elem)
window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context
else
dump('no element: ' + '@class="tag" and text()="' + tag + '"\n' );
liberator.dump('no element: ' + '@class="tag" and text()="' + tag + '"\n' );
}, 500);
}
@@ -1069,7 +1075,7 @@ const liberator = (function () //{{{
if (liberator.has("quickmarks"))
liberator.quickmarks.destroy();
window.dump("All liberator modules destroyed\n");
liberator.dump("All liberator modules destroyed\n");
liberator.autocommands.trigger("Quit", "");
},