WebPagetest Forums
Bug in Chrome Extension (setDOMElement) with possible solutions - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Bugs/Issues (/forumdisplay.php?fid=10)
+--- Thread: Bug in Chrome Extension (setDOMElement) with possible solutions (/showthread.php?tid=12423)



Bug in Chrome Extension (setDOMElement) with possible solutions - cws - 07-24-2013 07:02 PM

Webpagetest 2.11 contains a bug in chrome extension that prevents the setDOMElement command from working: The tab id isn't found and no event to search for the dom element is fired:

- In wpt.commands.CommandRunner.prototype.doSetDOMElements (file commands.js) is checked if g_tabid is set before firing setDOMElements request).
- g_tabid is set via the constructor of CommandRunner (wpt.commands.CommandRunner in commands.js)
- Method wpt.commands.CommandRunner.prototype.doSetDOMElements isn't called by an instance of CommandRunner (it's called directly at the event onBeforeNavigate in commands.js)
-> g_tabid isn't initalized because namespaces restrict its domain

Example Script:
setDOMElement id=location
navigate https://www.webpagetest.org
Result (using Chrome): http://www.webpagetest.org/result/130724_QJ_N3C/

Possible solution:
- Move definition of g_tabid (var g_tabid = 0) from background.js to command.js (above goog.require('wpt.logging'))
- Another solution would be creating an instance of CommandRunner before calling method wpt.commands.CommandRunner.prototype.doSetDOMElements


RE: Bug in Chrome Extension (setDOMElement) with possible solutions - pmeenan - 07-25-2013 06:50 AM

Thanks, fixed - https://github.com/WPO-Foundation/webpagetest/issues/95 (not in a released agent yet though)


RE: Bug in Chrome Extension (setDOMElement) with possible solutions - mark9white - 09-16-2013 11:41 PM

[quo
te='pmeenan' pid='21555' dateline='1374699032']
Thanks, fixed - https://github.com/WPO-Foundation/webpagetest/issues/95 (not in a released agent yet though)
[/quote]

I did a build of the Chrome extension from master, and copied it onto a WebPageTest slave box. Unfortunately DOM element measurements for Chrome still don't work work (though working fine in IE9 on the same box) - is Chrome setDOMElement working in master for anyone?

Seems either this didn't fix it or there's another bug ...