HP Support Forum
Reply
This HP Community is for Customer to Customer Product Support. First Time Here? Check Out Videos on How to Search, Register, Post and More.

HP Smart Web Printing breaks Adblock Plus in Firefox (accessing document too early) (2086 Views)
palant
Student
Posts: 1
Registered: 01-03-2010
Message 1 of 1 (2,086 Views)
0

HP Smart Web Printing breaks Adblock Plus in Firefox (accessing document too early)

I got a report that HP Smart Web Printing breaks Adblock Plus extension in Firefox. I checked the extension, the file toolbar.js in chrome/smartwebprinting.jar seems to cause the issue:

 

// Code at global scope
addEventListener("load", hpInitToolbar, false);

var printcmd = document.getElementById("cmd_print");
if(printcmd)
{
  printcmd.setAttribute("oncommand","NormalPrint();");
}

var printpreviewcmd = document.getElementById("cmd_printPreview");
if(printpreviewcmd)
{
  printpreviewcmd.setAttribute("oncommand","NormalPreview();");
}

 

This registers a listener for the "load" event - but some actions are carried out immediately, without waiting for the event to happen. Accessing browser's document before it is loaded breaks Adblock Plus and probably causes the issues reported in http://h30434.www3.hp.com/t5/Mobile-and-Web-printing/HP-SWP-and-Firefox-3-5-6-don-t-agree/td-p/19346... as well. Moving the code after addEventListener() call into hpInitToolbar function should fix the issue.

 

Unfortunately, I don't see any way to report this bug other than creating a topic here.

Please use plain text.


† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation