Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Version 25 no longer allows copy to clipboard

  • 6 replies
  • 8 have this problem
  • 77 views
  • Last reply by nh2_

more options

This is a follow-up to https://support.mozilla.org/en-US/questions/936323 since that question says "This thread was archived. Please ask a new question if you need help".

In older versions of Firefox, I could set `signed.applets.codebase_principal_support` in `about:config`, so that web sites trying to write to my clip board would get a pop-up asking me whether I want to allow this.

In newer version of Firefox (currently 25), this functionality does not work any more.

I am developing/maintaining a password tool that allows you to copy a password into the clipboard *without viewing it* (so that it cannot be read off the screen by bystanders). This used to work in oder Firefox versions, but now it stopped working.

I have read the related links, but they are quite out of date:

http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard (not edited since 2010, others reported that it doesn't work) http://www-archive.mozilla.org/projects/security/components/signed-scripts.html (linked from the page above, mentions itself that it is out of date) https://addons.mozilla.org/en-US/firefox/addon/allowclipboard-helper/ (does not seem to work)

Is there any way in current Firefox to write to the clipboard?

Thank you!

This is a follow-up to https://support.mozilla.org/en-US/questions/936323 since that question says "This thread was archived. Please ask a new question if you need help". In older versions of Firefox, I could set `signed.applets.codebase_principal_support` in `about:config`, so that web sites trying to write to my clip board would get a pop-up asking me whether I want to allow this. In newer version of Firefox (currently 25), this functionality does not work any more. I am developing/maintaining a password tool that allows you to copy a password into the clipboard *without viewing it* (so that it cannot be read off the screen by bystanders). This used to work in oder Firefox versions, but now it stopped working. I have read the related links, but they are quite out of date: http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard (not edited since 2010, others reported that it doesn't work) http://www-archive.mozilla.org/projects/security/components/signed-scripts.html (linked from the page above, mentions itself that it is out of date) https://addons.mozilla.org/en-US/firefox/addon/allowclipboard-helper/ (does not seem to work) Is there any way in current Firefox to write to the clipboard? Thank you!

All Replies (6)

more options

You're doing this in an extension? Extensions typically have privileges that ordinary websites do not have. For advice on those mechanisms, you could try one of these forums:

more options

The code that I posted in the that thread ([/questions/936323#answer-393468]) still works for me.

What method are you using to copy data to the clipboard?

Is that code that you run on a web page?
If that is the case then it most likely won't work and you will have to code this in an extension.

more options

No, I was not doing this in an extension, I was using plain Javascript.

I was using this: https://gist.github.com/nh2/7406314

Is there a non-extension way to do this?

more options

Firefox has a password file in it. You could also go to the Firefox add-on web page for password add-ons to help you. There as also automatic form fillers you can look at. [https://addons.mozilla.org/en-US/firefox/ Firefox add-ons web site Firefox add-ons.]

more options

The netscape.security.PrivilegeManager.* prefs are no longer supported in current Firefox releases (Bug 546848), so you can't use this anymore.


more options

For now, I help myself with something like this:

 function copyToClipboard(text) {

   // Spawn an invisible text box (far outside the document),
   // put the text in and select it so that the user can copy
   // it with the platform specific key combination.

   $('<input type="text" class="hidden-copy-input">').appendTo('body')
     .css({ position: 'fixed', top: -1000000, left: -1000000 })
     .val(text)
     // Remove from DOM on unfocus
     .focusout(function() { $(this).remove(); })
     .select();

 }

Modified by cor-el