Security preferences

To protect users' private information, unprivileged scripts cannot invoke the Cut, Copy, and Paste commands in the Mozilla rich text editor, so the corresponding buttons on the Mozilla Rich Text Editing demo page will not work. To enable these functions, you must modify your browser preferences.

Changing the preferences in Firefox

  1. Quit Firefox. If you have Quick Launch running (on Windows, this is an icon in the toolbar), quit that too.
  2. Find your Firefox profile directory.
  3. Open the user.js file from that directory in a text editor. If there's no user.js file, create one.
  4. Add these lines to user.js:
    user_pref("capability.policy.policynames", "allowclipboard");
    user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org");
    user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
    user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
    
  5. Change the url https://www.mozilla.org to the site for which you want to enable this function.
  6. Save the file and restart Firefox. The Clipboard buttons should now function.
Note: The preference is site as well as protocol specific. For example:
user_pref("capability.policy.allowclipboard.sites", "http://www.mozilla.org")

is not the same as:

user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org")

This is because the first uses HTTP while the second uses HTTPS.

If you want to allow multiple URLs to access the Paste operation, separate the URLs with a space. For example:
user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org https://developer.mozilla.org")

See also

For more information about security policies, see this article about Configurable Security Policies.

 

Document Tags and Contributors

Contributors to this page: sahabatmobilsukses, mmeladakis, rb9926, jswisher, Bnote3, trevorlewinter, mulyo.wiharto, BAYBHeff, grebbien, ROCKYYYYY, mel.griffin, G-BASS, anna.radzicka@gmail.com, CristinaH, bela3333, Brownsan, charlottehardy32, 2013115, Y0537878Z, Sheppy, remas2010, copitlory, fscholz, VISION2FREEDOM, jackysuandi, marly, mbellanie, AMIB, roberson32, simin_nemati, Ainun1999, Lejonprinsessan, relampiega, stelamia, sweetiepie197730, mjbrasda, FlyingAngel007, aubrey, agungaji92, aamir, ArashFernando, Ali., dave, isael_araujo, ayomikeven, 1346110, william_joc, shuff1349, ella-kelly, padominguex, ligh103549, scantu, PPLK_SYELDAH_INDONESIA, tdash0355, iGOT2, nekad93, Dr.chisulo@gmail.com, elizabethmcelre, rawoodson22, SEXYRIMMA, Horace_McNeill, marthahk, Frankie, clanghans, peaches56, dmoore2, amrifahrizal23@yahoo.com, sabin1001, Thea5911, Meriemtazir, Laurie, bluesman, joshua_essiam, Majhok-Chaw, sheisler, okins, slim242, teoli, francois.boutin@free.fr, canggihfitrahh, KeeferKRockasocki, angiolinag, Kathymanu, devin_linnington, KITAGAWA, heycynh@aol.com, ethertank, camzephir1, muhammed, web4dealz, peterm9, nsewan, stevekellman, amandacrites, sharadwms, sonimo@hotmail.com, anavcuesta, js120876, a.verdell_93@yahoo.com, sujankhan, afelds813, gstevens2014, nannance, momakarebear, afbank, missfiyared, maryjackson5754@yahoo.com, diane.j.williams, mazengamal, mat, lewi07, mariscal_araceli, tami.deangelis, lanecap20, didiz, fatemehsaeidy, mvdblue, Jcelaya, soreque.tania, moorezilla, leah988, Davidwboswell, pusatforex.com, kentrell.pattillo, ashsutton, ELPIDIO, cherrish.berryman, tori5801, polo, trevorh, rmorrison, yvonne_narcisse, Graha, vietanh98, malloryee, bokepz10, lis0806, kcohen, 3928022, Saulo_Dum, alym1005, rugratchaser1, bregis, calypso44000, jamalsoufane, dunka09, ronyworld, matilda1107, Abe77, TECNOSAMSUNG, faithregan, hadraj, musettemarie27@yahoo.com, bakecapasion, kscarfone, mawanaja, Kali, michelle25, roxanaesther, ezarda, tenerezza, kristina728, jjp1969@gmail.com, mikaellaescort, collinsaffum@gmail.com, Daviz, rogeriolimaramos, dika, yummy71, ChessicaRae, phenora, udinsa, cheryl_putri, sadra, elcantor67, floriane, Ayu, hank778@gmail.com, brown_r10390, zaza256, nicholas, chang, jamma, adi.nurmahdi, remas2011, leann_spesard, kurt10on, l3k0vic_98, abu.bakar66@hotmail.com, anthonyperez0530, shirleytcowan@gmail.com, sepriadi.sepriadi@yahoo.co.id, eezila28, chiromo1, ElliBelli, akabouya, melissa, insulaser, lorenehopkins, sacf, janrz
Last updated by: ROCKYYYYY,