mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-11 14:25:47 +01:00
add DOMLoad autocmd event
This commit is contained in:
@@ -300,6 +300,8 @@ liberator.Events = function () //{{{
|
||||
}, false);
|
||||
}
|
||||
|
||||
getBrowser().addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
|
||||
|
||||
// this adds an event which is is called on each page load, even if the
|
||||
// page is loaded in a background tab
|
||||
getBrowser().addEventListener("load", onPageLoad, true);
|
||||
@@ -447,6 +449,13 @@ liberator.Events = function () //{{{
|
||||
return false;
|
||||
}
|
||||
|
||||
function onDOMContentLoaded(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
liberator.autocommands.trigger("DOMLoad", event.originalTarget.location.href);
|
||||
}
|
||||
|
||||
// TODO: see what can be moved to onDOMContentLoaded()
|
||||
function onPageLoad(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
|
||||
Reference in New Issue
Block a user