Hi Geoff,

I've been trying to figure this out as well, only to find that this functionality may have disabled for security reasons. See bug:

http://bugzilla.mozilla.org/show_bug.cgi?id=192355

Frustrating, but it's important to keep the lizard secure.

Alex

Geoff Taylor wrote:
Hi,

I'm working on a WYSIWYG edit control that will use Midas on Mozilla 1.3+,
and I've run in to a problem.  I'm hoping someone here will understand
what's going on.

In a nutshell, it's all working wonderfully except for Cut, Copy and Paste.
When I try and do any of these, I get an error:

Error: uncaught exception: [Exception... "Access to XPConnect service
denied"  code: "1011" nsresult: "0x805303f3
(NS_ERROR_DOM_XPCONNECT_ACCESS_DENIED)"  location: "<unknown>"]

Here's the simplest code that demonstrates the problem.  When running the
code below, Cut throws the error but Bold works properly.

<html>
 <head>
  <title>Test</title>
  <script>
  function Init()
  {
   document.getElementById('edit').contentWindow.document.designMode = "on";
  }
  </script>
 </head>
 <body onload="Init()">
  <iframe id="edit" width="100%" height="200px"></iframe>
  <br>
  <input type="submit" value="Cut" id="cut"
onmousedown="event.preventDefault();"
onclick="document.getElementById('edit').contentWindow.document.execCommand(
'cut', false, null)">
  <input type="submit" value="Bold" id="bold"
onclick="document.getElementById('edit').contentWindow.document.execCommand(
'bold', false, null)">
 </body>
</html>

As you can see, that code is pretty trivial.  The Midas demo works fine for
cutting, copying and pasting, and I just can't see why the above code is
different.

Any ideas or thoughts?

Cheers,

Geoff

--?
http://www.opinionatedgeek.com/ :: Part of the solution






Reply via email to