An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to gostips@gmail.com.

October 29, 2006

Enabling Copy-Paste for Google Office in Firefox


Firefox has a feature that prevents rich-text editors from using copy, cut and paste. A malicious script could read the content from your clipboard and send it to a server. Your clipboard might contain sensitive information, so you don't want to let every site read the clipboard.

Unfortunately, these restrictions make sites like Google Docs & Spreadsheets harder to use, as you can't use options like: copy, cut, paste from the menus and you have to use browser's Edit menu or keyboard shortcuts.

If you want to enable these options for this site, you have to:

1. Open this file in Notepad:
For Windows 2000/XP:
C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\[profile name]\user.js

replace [username] with your Windows username and [profilename] with the name of your active profile (most likely, the only profile)

For other operating systems: see here.

2. Append these lines:

user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites", "http://docs.google.com");
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");

You can add more sites in the second line, but they have to separated by spaces, like this:
user_pref("capability.policy.allowclipboard.sites", "http://docs.google.com http://www.zohowriter.com");

3. Save the file and restart Firefox to see the effect.

21 comments:

  1. Oh... I use Firefox 1.5.7 and Google's web apps work fine for me. The right-click context menu appears as it should, too!

    I do remember it not working, however for a while, until I made a change in the Options for Firefox. I went to 'web features' then to 'javascript' then to 'advanced' then I 'allowed right-click menus' and it worked.

    I didn't have to do anything complicated like you're suggesting.

    ReplyDelete
  2. Hey, I didn't talk about enabling the right-click menu from Google Docs. In case you didn't understand, the purpose of the post was to show you how to actually use the options copy/cut/paste from that contextual menu.

    ReplyDelete
  3. if you only wanna copy, cut and paste in docs with firefox, simplely use the keyboard short cut like ctrl+c, ctrl+x, ctrl+v. they'll work just fine.

    why do you have to use the right click menu???

    sorry for my bad english, maybe i don't understand the post quite well.

    ReplyDelete
  4. Nice tip, Ionut! And thanks for including Zoho Writer :-)

    ReplyDelete
  5. I agree, 8O. I always those keyboard shortcuts, but there are many people that like to use the contextual menu, like in Microsoft Word, and they can't.

    ReplyDelete
  6. Not everyone uses a keyboard. Many people, like myself, use Tablet PCs or UMPCs, so we need the menus working.

    ReplyDelete
  7. For those of you who cannot find your "user.js" file, you may have a "prefs.js" file that holds your user-preferences. I'm using FireFox 2.0.0.5 on a WinXP machine. I hope this helps.

    To throw in my two-cents, I go back and forth between keyboard short-cuts and right-click menus myself, depending on what I am doing. Since FireFox tells me that I have misspelled word, but Google Docs takes over my right-click menu, I cannot see the suggestions in that menu. I have to copy-paste the word into something that will suggest spellings. (I had no idea "temperament" had an "a" in it. :) )

    ReplyDelete
  8. This is a great tip. I normally use shortcut keys but they do not function correctly in Google Spreadsheets. They generally don't work at all, and the times they do it often messes up. But enabling Google to access the clipboard without a buffer fixed that problem.

    ReplyDelete
  9. For me (Vista) the user.js file was not there so I created it and added the lines. Worked great.

    Nothing worse than right clicking something, realizing it doesn't work in FF and having to re-highlight it.

    This tutorial was a great find thanks!

    ReplyDelete
  10. fantastic tip, thanks.

    ReplyDelete
  11. At Firefox version 3.03...

    Tools menu
    Options
    Content tab
    Enable Javascript (presumed checked)
    Advanced button on same line
    Uncheck "Disable or replace context menus"

    gmt

    ReplyDelete
  12. There is a solution for windows vista too?

    ReplyDelete
  13. very helpful, thank you very much! I was afraid there is a problem in my site. now I am relieved.

    ReplyDelete
  14. It doesnt work with Windows XP and Firefox 3.5.1. I have installed the recommended extension for Firefox - AllowClipboardHelper + the advise of adding the lines to user.js. Now I can paste but not to cut/copy. Also after the mark of Disable or replace context menu have been changed to not marked, it appeared to have two menus one after other and the second (the script one is still not working).

    So this is not a solution. For further information I am using Wordpress with FSCKEditor. If I remove the editor (stop the plugin) all becomes to work flawlesly, but with it nope!

    ReplyDelete
  15. It works, but in version 3.6 impossible to paste formatted text (bold, italic...)

    ReplyDelete
  16. Do you have a solution for Chrome, i need it?

    ReplyDelete
  17. Do you have a solution for Chrome, i need it?

    ReplyDelete
  18. This is December 2011 with FF 8.0 and this still works GREAT!

    Anonymous said...

    At Firefox version 3.03...

    Tools menu
    Options
    Content tab
    Enable Javascript (presumed checked)
    Advanced button on same line
    Uncheck "Disable or replace context menus"

    gmt

    ReplyDelete
  19. Solution for Chrome is to install the Google Docs app. Is there a similar app for Firefox? Instead of digging around in config files?

    ReplyDelete
  20. Work Around, mentioned previously in this blog that works!

    Select all you want to copy, drag them into another source, I.E. A search toolbar. Then copy from there.

    ReplyDelete

Note: Only a member of this blog may post a comment.