2011-06-15 41 views
0

我正在開發一個firefox extension。我需要在調用print函數時將一些html元素注入到當前瀏覽器選項卡中加載的網頁中。然後頁面應採取打印機隨着注射html元素如何在Firefox中調用'onbeforeprint'函數

我搜索和MDC

https://developer.mozilla.org/En/DOM/HTMLBodyElement

,我不知道用功能的發現onbeforeprint功能。我試圖用它作爲一個事件。

window.addEventListener("onbeforeprint",
function(){alert("Print called");},
false);

但它失敗。請在這方面幫助我。

回答

0

據我所知,此功能剛剛添加,並且只會在Firefox 5或6中提供。