Re: Doesn't work on Firefox
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Doesn't work on Firefox

From: RobG <rgqld@iinet.net.auau>
Date: Wed Jul 20 2005 - 02:24:48 CEST

Wayne W wrote:
> Thanks.... I'll keep looking.
>

Please don't top-post. Although that is the default behaviour of
Outlook Express, but it's not the preferred layout of this group.

Here are a couple of links regarding using the clipboard and Mozilla:

<URL:http://www.infogears.com/cgi-bin/infogears/mozilla_firefox_copy_paste.html>

<URL:http://www.mozilla.org/projects/security/components/per-file.html>

Users can allow access to the clipboard on a per-site basis, however it
requires modification of user preferences that are likely beyond the
average web surfer. As a result you should expect that, in a general web
context, clipboard support is not available.

If your usage is for an intranet, and you can control a users' settings,
then maybe you can make it work reliably. This newsgroup is intended to
focus on JavaScript for the web, hence responses tend to bent in that
direction.

> Wayne
>
> "Baconbutty" <julian@baconbutty.com> wrote in message
> news:1121792887.330657.89070@g14g2000cwa.googlegroups.com...
>
>>Sorry, forget my answer. I note you have got this covered in your code
>>above.
>>
>>I would like to respectfully disagree with RobG.

Yes, I was a bit dismissive. :-x

Mozilla does support the clipboard, but only through specific user
actions to allow access to it. Page authors should not expect clipboard
support to be available, and therefore should probably not attempt to
use it. The links above show how to enable it - I don't think your
average user is going to be able to do it even if you can convince them to.

Support within an intranet may be able to be made more reliable.

>>
>>I think that Firefox does support clipboard operations (as did
>>Mozilla), through XPConnect as you note.
>>
>>Your "if" statements should also discount other browsers, as you
>>correctly do this by means of a "feature" test.

The feature tests are insufficient - testing for 'window.netscape' does
not ensure that PrivilegeManager.enablePrivilege is supported, or that
the user will allow the privileges to be modified.

That call should be inside a try..catch block in case the user refuses
to change their privileges, or you can let them deal with the message
starting:

    "A script from /your_domain/ is requesting enhanced abilities that
     are UNSAFE and could be used to compromise your machine or data:"

[...]

-- 
Rob
Received on Tue Oct 18 02:58:30 2005