Ticket #163 (new defect)

Opened 3 months ago

Last modified 2 months ago

script cannot define a function named onkeypress

Reported by: arenevi..@fdn.fr Assigned to:
Priority: major Milestone:
Version: Keywords:
Cc:

Description

Hi,

if I try to use a function name onkeypress in a script, loading that script in a file triggers an exception:

Components is not available

Attachments

Change History

09/26/08 13:10:48 changed by anonymous

This is because expando properties are disabled in XPCNativeWrappers (what GM wraps DOM objects in).

See http://wiki.greasespot.net/XPCNativeWrapper#Expando_Properties.

Consider using .addEventListener('keypress', function() { ... }, false) instead.

If you're not trying to register a keypress listener for the document (as onkeypress is supposed to do - http://www.w3schools.com/jsref/jsref_onkeypress.asp) consider renaming your function.


Add/Change #163 (script cannot define a function named onkeypress)