• 0

[FF/Extension] Page Completely Loaded Event?


Question

Hello,

I am working on a FF Extension, and need to execute a function after a web page is fully/completely loaded.

On my .js file I have the following codes, and it works but buggy!

window.addEventListener("load", function() { myExtension.init(); }, false);

var myExtension = 
{
  init: function()
  {
	var appcontent = document.getElementById("appcontent");   // browser

	if(appcontent)
	  appcontent.addEventListener("DOMContentLoaded", myExtension.onPageLoad, true);
  },

  onPageLoad: function(aEvent)
  {
	$mb = jQuery.noConflict();
	doc = window.content.document;

	$mb(doc).ready(function()
	{
		//Do Stuff
	});
  }
}

The problem is, the function I want to execute on the Do Stuff section actually keeps executing while the page is still not fully loaded.

Is there any event that basically flags that everything completely loaded (DOM, images, whatever), and I can execute my desired actions?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.