Is it possible to intercept in the browser (from chrome) a print command from Javascript, i.e.

- window.print()
- javascript:print()

I have the following code, which is not working:

// global
addEventListener("load", aInit, true);

function aInit()
{
  gBrowser.selectedBrowser.addEventListener("load", JSPrintOverride, true);
}

function JSPrintOverride ()
{
  var b = document.getElementById("content");

  b.contentWindow.print = function ()
  {
    alert("Print event traped!");
    // more processing here
  }

  return null;
}

--
Brian King
www.mozdev.org - free project hosting for the Mozilla community
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to