InfoGears Inc. Logo
InfoGears () noun. Flexible, affordable software modules that seamlessly work together to provide powerful business solutions.
 Home   |   Request More Information   |   Success Stories 
Customer Login:
Username:
Password:


MerchandiseIQ
Enable Cut/Copy/Paste In Mozilla/Firefox While Using HTMLArea Or Other Rich Text Editor
Author: Josh Rosenbaum
Comments/Questions? Contact us here.

Developers: Trying to figure out how to cut/copy/paste in Mozilla/Firefox using javascript? Look Here.

Security Concerns: - You should only enable cut/copy/paste on sites that you trust. (And only cut/copy on sites that you semi-trust.) The reason for this is that you may have a password, credit card information, phone numbers, or some other sensitive information in your clipboard and you do not want bad sites to have access to that. InfoGears will never try to abuse any privilege you grant to your site.

To enable cut/copy paste on all sites, then check the bottom of this article.

Novice Users (Or users who want the details hidden):

Note: If you wish to only allow cut/copy or only paste, then view the below sections. Also, if you do not want to use an extension then look below. (I prefer not to use extensions as they can slow the browser slightly, although this particular one does not seem to be noticeable.)
  • Install AllowClipboard Helper. (If you already have this, skip down to Tools->AllowClipboard Helper.) Note: When you click Install on this page, a popup bar may popup at the top of the current page asking you to allow the site. Go ahead and do this.
  • Bookmark this page so you can come back after you exit your browser.
  • Exit(Close) all browser windows.
  • Restart your browser.
  • Click Tools->AllowClipboard Helper.
  • Add your domain: 'www.mysite.com' in the server address text box and click 'Allow'.
    (Or you can use http://www.mydomain.com and https://www.mydomain.com
    Do not include an ending slash on the website or copy/paste will not work.)
  • Click Ok.
  • Close all browser windows.
  • Restart your browser, and copy/paste should work for you in HTMLArea.
  • If you want to uninstall the AllowClipboard Helper plugin once you have verified things are working: In FireFox goto Tools->Extensions. Click on AllowClipboard Helper in your extension window and click Uninstall.
Note about AllowClipboard Helper: AllowClipboard Helper will show a tab under your Rich Text HTML Editors if it thinks cut/copy/paste is disabled. (Feel free to test yourself.) You can easily add a site to your allowed list by clicking this tab and clicking allow in the AllowClipboard Helper window. If you do not want these tabs then go here to remove them: "Tools->Extensions->AllowClipboard Helper->Options".

Novice Users:

Note: This method could be prone to user error. You may want to try the next one where you install a plugin, do a copy/paste, and then edit a value.

  • 1) Create a new window or tab.
  • 2) type 'about:config' into your url bar. (No quotes.)
  • 3) Now right click in the content section of the browser, and select New->String.
  • 4) Enter 'capability.policy.policynames' into the "New String Value" box. (Without quotes.)
  • 5) Click OK
  • 6) Type 'allowclipboard' in the "Enter string value" box. (Without quotes.)
  • 7) Click OK

Repeat steps 4-7 with the following string name/value pairs:
NOTE!: Replace both www.mysite.com values with your domain name. Do not include an ending slash on the website, or copy/paste will not work. Also note that you can add multiple sites using spaces.
NameValue
capability.policy.policynamesallowclipboard
capability.policy.allowclipboard.siteshttp://www.mysite.com https://www.mysite.com
capability.policy.allowclipboard.Clipboard.cutcopyallAccess
capability.policy.allowclipboard.Clipboard.pasteallAccess

You may want to bookmark this page in case you need to come back.
Now exit all Firefox/Mozilla browser windows. You should now be all set to use copy/paste. Restart your browser.

Novice/Intermediate/Advanced

  • Install the ChromEdit extension: http://extensionroom.mozdev.org/more-info/chromedit
    Note: When you click Install on this page, a popup bar may popup at the top of the current page asking you to allow the site. Go ahead and do this.
  • Bookmark this page so you can come back after you exit your browser.
  • Exit(Close) all browser windows.
  • Restart your browser.
  • Click Tools->Edit User Files.
  • Select user.js.
  • Copy the data between the lines below, and paste it into the user.js box:
    //-------------------------------------
    user_pref("capability.policy.policynames", "allowclipboard");
    user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
    user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
    user_pref("capability.policy.allowclipboard.sites", "http://www.mysite.com https://www.mysite.com");
    //-------------------------------------
  • Change both www.mysite.com values to your domain name. (ie. www.infogears.com) Make sure to leave off the trailing slash. You can add more sites simply by using a space in between each one.
  • Click Save.
  • Close the window.
  • Close all browser windows.
  • Restart your browser, and copy/paste should work for you in HTMLArea.
  • You may want to uninstall the ChromEdit plugin once you have verified things are working. If you do: In FireFox goto Tools->Extensions. Click on ChromEdit in your extension window and click Uninstall.

Advanced Users:

  • Close all Firefox/Mozilla browser windows.
  • Navigate to your Firefox profiles directory. In Windows XP it will be something like:
    C:\Documents and Settings\<XP Username>\Application Data\Mozilla\Firefox\Profiles\(8 random letters here).default
    (You may need to turn off hidden system files for Windows XP to show this directory.)
  • Open prefs.js in a text editor like notepad. (You can also edit/create user.js and use that file instead.)
  • Copy/Paste the data between the two lines below into the file.
    //-----------------------------------------------------------
    user_pref("capability.policy.policynames", "allowclipboard");
    user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
    user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
    user_pref("capability.policy.allowclipboard.sites", "http://www.mysite.com https://www.mysite.com");
    //-----------------------------------------------------------
  • Substitute www.mysite.com with your domain name. NOTE: do not include an ending slash on the website, or copy/paste will not work. Also note that you can add multiple sites using spaces.
  • Save/Close The File
  • Restart your browser. Copy/Paste should now work.

How Do You Make Cut/Copy/Paste Work On All Sites?

This is not recommended, as you are opening yourself to security problems by trusting all sites. If you ever have sensitive information in your clipboard (ie. you copy phone numbers, credit card numbers, passwords, etc), then using this is not a good idea. With that said, here's how to do it:
  • Instead of copy/pasting the lines in the above instructions you only need to copy/paste this instead:
    //-----------------------------------------------------------
    user_pref("capability.policy.default.Clipboard.cutcopy","allAccess");
    user_pref("capability.policy.default.Clipboard.paste", "allAccess");
    //-----------------------------------------------------------


Contact Us | Privacy Policy | Service Agreement | Spam Policy
© Copyright 2010 InfoGears Inc. P.O. Box 6701 Bozeman, MT 59771-6701 406.582.1200
Powered by InfoGears
Valid XHTML Valid CSS Made for Firefox