[Webkit-unassigned] [Bug 35849] New: F5 and Ctrl-F cannot be suppressed with preventDefault

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 7 18:30:42 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=35849

           Summary: F5 and Ctrl-F cannot be suppressed with preventDefault
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ivan at ivanpeters.com


event.preventDefault() appears to have no effect on F5 (refresh) and crtl-f
(find) keys. For example, the following code will suppress all keyboard events
except F5 and ctrl-f:

======
function cancelEvent(e) {
    e.preventDefault();
}

document.addEventListener("keydown", cancelEvent);
document.addEventListener("keypress", cancelEvent);
document.addEventListener("keyup", cancelEvent);

======

This is a Windows-only issue. Obviously, the OS X version doesn't have F5 for
refresh, but the above code will suppress command-R and command-F (and
everything else I tried).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list