[TIP] Disable keyboard shortcuts in html coverage reports?

Ned Batchelder ned at nedbatchelder.com
Fri Feb 28 03:02:24 PST 2014

On 2/26/14 11:05 PM, Thomi Richards wrote:
> Hi,
> I use coverage.py's HTML coverage reports a lot, and they're great, 
> except that the keyboard shortcuts seem very broken. For example, when 
> I'm in the coverage report for a file, if I press the 'alt' key (which 
> I do as part of Alt+tab, for example) the browser will jump to 
> somewhere near the top of the page. Additionally, the space key 
> toggles highlighted lines, even though that's not mentioned as one of 
> the shortcut keys. It seems like whatever code is responsible for 
> matching key presses to js code is being a little too aggressive.
> I'm no JS expert, but it looks to me like pressing the 'alt' key 
> triggers the handler function in coverage_html.js, specifically, this 
> code:
>    $(document).bind('keydown', c.substr(9), function () {
>                      $(e).click();
>                  });
> But the 'e' objects class is 'shortkey_r' or 'shortkey_m'.
> Is there any additional information I can provide to help debug this? 
> Alternatively, is there an easy way to disable the shortcut key support?
> I'm on Ubuntu Trusty Tahr, and can reproduce the problem with both 
> Firefox and Chromium. Has anyone else had this issue?

Thomi, I don't see this issue on Mac 10.8 or on Precise in either 
Firefox or Chrome.

> Cheers,
> -- 
> Thomi Richards
> thomi.richards at canonical.com <mailto:thomi.richards at canonical.com>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140228/c33b7f0c/attachment.html>

More information about the testing-in-python mailing list