firefox addon - Keypress event bubbling up from embedded browser -
i have firefox extension adds button toolbar (navbar exact). when button pressed, xul <panel> (which child element of button) opened <iframe> embedded in it. html document loaded panel display contents of popup.
if html contains input field, not expect keypress events in field bubble dom. however, do bubble <panel> contains embedded iframe , thereforth toolbar button. idea why panel gets events though should captured , processed html elements in embedded browser?
you need use type="content" on <iframe> tag events stop @ frame boundary - that's 1 of security mechanisms protecting browser's chrome content pages. prevents javascript code in frame accessing browser's chrome via window.parent , changing location example. note frame can still have chrome privileges regardless of - can load chrome:// url browser tab , work correctly.
the obvious alternative (for trusted frame content only) call event.stoppropagation() in event handler attached <iframe> tag. note default widgets (input fields included) don't when handle events, rather call event.preventdefault(). makes sure higher-level widgets ignore event, own code can still handle however.
Comments
Post a Comment