Firefox 3.5 - Allow JS Access to clipboard on a limited basis

Bug #472882 reported by Jonathan Hayward on 2009-11-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
New
Medium
firefox-3.5 (Ubuntu)
Wishlist
Unassigned

Bug Description

I heavily use a modified Ajaxterm (downloads from http://JonathansCorner.com/terminal/ ), more than other terminals.

One major function is pasting text into the terminal session, which only works for Ajaxterm if the script is allowed to access the clipboard. Firefox disallows this by default, but 3.0.x allows this to be turned on per instructions at http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard . So far no attempt to do this under 3.5.4 has succeeded; see http://forums.mozillazine.org/viewtopic.php?f=38&t=1570755&p=7901575#p7901575 for forum discussion and https://bugzilla.mozilla.org/show_bug.cgi?id=526237 for a bug that has so far not been acted on.

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4) Gecko/20091028 Ubuntu/9.10 (karmic) Firefox/3.5.4
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4) Gecko/20091028 Ubuntu/9.10 (karmic) Firefox/3.5.4

I want to use a localhost, port 8022 Ajaxterm's (JS-based) Paste button and I have not found a way to enable it yet.

I have created a user.js with the contents:

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

No observable change in behavior; Ajaxterm still complains that its Javascript paste attempt is getting a permission denied error.

Changing the second line to:

user_pref("capability.policy.allowclipboard.sites", "http://localhost http://localhost:8022");

does not work. I have tried to edit about:config but not found options that look like they will help.

I have more specifically been using modified Ajaxterm, changed in its CSS from Ajaxterm 0.10, available from http://jonathanscorner.com/terminal/ ; there has been no change to the JavaScript. This issue has also been discussed at the Mozillazine thread at http://forums.mozillazine.org/viewtopic.php?f=38&t=1570755&p=7901815#p7901815.

I have upgraded my computer from Jaunty to Karmic; Firefox 3.0.x under Jaunty was allowing the JavaScript paste in question.

Jonathan
http://JonathansCorner.com/

Reproducible: Always

Steps to Reproduce:
1. On a similar system, download and unpack http://jonathanscorner.com/terminal/enhanced-terminal-0.11.tar.bz2 , enter the unpacked directory, and run ./ajaxterm.py
2. Point Firefox 3.5.4 to http://localhost:8022/
3. Select and copy some text.
4: In the browser window, click on the word "Paste" at the top right hand of the screen. [Observed behavior: immediately below the paste button, a message of "Access denied more info" appears]
5: Quit Firefox.
6: Add the following to the user.js file in the <salt>.default directory, creating user.js if needed:
user_pref("capability.policy.policynames", "allowclipboard");
user_pref("capability.policy.allowclipboard.sites", "http://localhost");
user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess");
user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
7: Restart Firefox.
8: Select some text again, and click the paste button. [I get the same error as before attempting to enable access.]
Actual Results:
As described in the steps to reproduce; each time the "Paste" button is clicked, there is an error message indicating that the script was not allowed to paste via JavaScript.

Expected Results:
On step 8, the previously copied text should have been pasted into the window as if it had been typed in.

Thank you for reporting this to Ubuntu. This is by design. Firefox 3.0 was removed from Karmic before release. Please report any other issues you may find.

Changed in firefox-3.0 (Ubuntu):
status: New → Invalid

This entails a noteworthy loss of functionality for me as 3.0 lets me do something valuable not working in 3.5.4.

I heavily use a modified Ajaxterm (downloads from http://JonathansCorner.com/terminal/ ), more than other terminals.

One major function is pasting text into the terminal session, which only works for Ajaxterm if the script is allowed to access the clipboard. Firefox disallows this by default, but 3.0.x allows this to be turned on per instructions at http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard . So far no attempt to do this under 3.5.4 has succeeded; see http://forums.mozillazine.org/viewtopic.php?f=38&t=1570755&p=7901575#p7901575 for forum discussion and https://bugzilla.mozilla.org/show_bug.cgi?id=526237 for a bug that has so far not been acted on.

Could this design be revised, possibly as an enhancement request for a package that in fact installs Firefox 3.0.x? I don't know how many people use my modifications to Ajaxterm at http://JonathansCorner.com/terminal/ , but this design decision has the implication that Ajaxterm users have no way to paste from a Firefox installed via the package manager, which is not a trivial matter.

Micah Gersten (micahg) wrote :

I've converted this to a request for what you have posted upstream. Firefox 3.0 will be EOL in 2 months, so we cannot add it back to Karmic.

description: updated
summary: - firefox-3.0 executable not provided by firefox-3.0 or firefox-3.5
- packages (Karmic)
+ Firefox 3.5 - Allow JS Access to clipboard on a limited basis
affects: firefox-3.0 (Ubuntu) → firefox-3.5 (Ubuntu)
Changed in firefox-3.5 (Ubuntu):
importance: Undecided → Wishlist
status: Invalid → Triaged
affects: pydcmtk → null
Micah Gersten (micahg) on 2009-11-06
Changed in null:
importance: Unknown → Undecided
status: Unknown → New
Changed in firefox:
status: Unknown → New
Michael Nagel (nailor) wrote :

closing task on NULL project

Changed in null:
status: New → Invalid
Changed in firefox:
importance: Unknown → Medium
Curtis Hovey (sinzui) on 2011-11-11
no longer affects: null
Changed in firefox:
status: New → Unknown
Changed in firefox:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.