Thursday, October 4, 2007

Cut and Copy broken in Internet Explorer

The commands oncopy, oncut, onbeforecopy, onbeforecut are broken in IE 6.0 and IE 7.0. I was unable to report these problems to Microsoft (see blog below). If a field is empty and copy or cut is used the browser does not report the event. This means that if the web page code has undo or any validation in the script or server side it will misfire. Google has an interesting fix for this in Google Spreadsheets. They never allow an empty field to be empty. They place a tab character in the field so that appears empty but really is not. However this took hundreds of lines of code to accomplish and has another problem. The browser does not allow focus on the field. If you do focus it does the tab and moves the focus to the next field. Onbeforecopy has an even bigger problem in IE 6.0. If you wand over edit in the drop down menu it fires the event. I was unable to actually do anything with this event. But if this is actually being fired by using the drop down menu could you trigger an event in the menu or use it to spy on the user. Does this focus go beyond the page you are currently in? Given that this could be a major security hole I am no longer using Onbeforecopy in any of my code. Since this HTML is only supported by Microsoft, web pages that support other browser do not use it.

No comments: