Firefox 18 freezes when attempting to copy with ZeroClipboard 1.0.7 #73

Closed
pkbarbiedoll opened this Issue Jan 11, 2013 · 24 comments

4 participants

@pkbarbiedoll

I confirmed that a user began having trouble using an existing, functional ZeroClipboard instance. The button copies a string of data (HTML), invokes a mail call to open an Email window, and the contents of the page are pasted in an email body using standard UI commands.

The problem happens when the button is clicked. Removing the email call does not fix. See test case further down for working example of problem.

What happens is the button is clicked, and Firefox freezes for 1-2 minutes before finally giving an 'Contents copied' alert which is triggered when the button is clicked.

The problem began as soon as the user updated Firefox from version 17 to 18.

@JamesMGreene
ZeroClipboard member

Could you please explain your scenario a little further, or show some code? With the way you've described it so far, I'm not sure why you would even use ZeroClipboard for this as it sounds like you are just putting the contents into a mailto: link rather than needing to put it into the user's clipboard at all.

@pkbarbiedoll

Apologies for any confusion in my original description of the problem.

ZeroClipboard copies some HTML content to clipboard because I am unable to pass the content with mailto:email@a.com?body=somecontent. Workflow is that users click the movie button, which opens a blank email. They then press Copy-V (or use the menu) to paste the content in the blank email body.

Apologies for the confusion.

I'll paste some sample code below (I've changed some variable names and such, since this is a public forum). This code works fine with Chrome, IE 7/8/9, and Firefox 17 and below. The delay/freezing problem began immediately after the version 18 auto update. Checked same script with another machine still on FF 17, no delay/freezing. I updated that machine to FF 18, and the freezing problem began.


<$php $output_clean = "<p>Some vanilla HTML/CSS here (avg size of content 200kb)"; ?>

    <script type='text/javascript' src='/includes/ZeroClipboard-1.1.6/ZeroClipboard.js'></script>

    <script language="JavaScript">

        function sendMail()
        {
            location.href='mailto:?subject=DataResult&body=%0D%0DResults below:%0D%0D';
        }

        var clip = new ZeroClipboard( document.getElementById('d_clip_button') );

        clip.on( 'complete', function(client, args) 
        {
            //alert("Copied text to clipboard: " + args.text );
            sendMail();
        });
        clip.on( 'mouseOver', function(client, args) 
        {
            //alert("Copied text to clipboard: " + args.text );
            clip.setText( document.getElementById('fe_text').value )
        });

    </script>

    <textarea id="fe_text" cols=50 rows=5 onChange="clip.setText(this.value)" style="display: none;"><?php echo $output_clean; ?></textarea>

    <div id="d_clip_container" style="position:relative">
        <div id="d_clip_button" class="button_copy_to_clip"> 
            <img src='clipboard_16.png' height=16 border=0>&nbsp; <b>Copy Record</b>
        </div>  
    </div>
@JamesMGreene
ZeroClipboard member

I'm seeing lots of FF18 issues out there on the web, both for JS and Flash. Could you please share your OS info (e.g. "Windows 7 (64-bit)") and Flash version (e.g. "11.5.31.5")? You can get your Flash version by visit this page [using Firefox 18].

Most of the issues I've seen so far mentioned that FF18 worked fine if they downgraded their Flash back to 10.3, so it seems to be a FF18 + Flash 11 incompatibility of some kind that — I'm assuming — Adobe (Flash) will have to fix on their end.

@pkbarbiedoll
@pkbarbiedoll
@jonrohan
ZeroClipboard member

hmm, maybe there is a flash clipboard limit that we're un aware of yet?

@JamesMGreene
ZeroClipboard member

Not sure about any limits in Flash... certainly nothing in their documentation. As for Windows, my past experience suggests that the maximum clipboard size is roughly equivalent to the amount of free virtual memory.

@pkbarbiedoll
@JamesMGreene
ZeroClipboard member

Sure, let us know when you the repro available. Thanks!

@pkbarbiedoll
@pkbarbiedoll

Update:
The mozilla folks are looking into the problem with Firefox from their end: https://bugzilla.mozilla.org/show_bug.cgi?id=829557

Summary: FF 18 and above freezes when clicking ZeroClipboard 1.0.7 (confirmed by multiple testers).

There is a separate issue with ZeroClipboard 1.1.6 under #87

@JamesMGreene
ZeroClipboard member

Ugh, sounds like Firefox 18-19 users are screwed... hopefully not FF20 users! 😕

From Bugzilla:

It's unlikely we'll fix for FF19 at this point (this is a non-critical regression in FF18), but we'll definitely take a fix for FF20 once ready.

@JamesMGreene
ZeroClipboard member

For the record:
According to the linked Firefox bug, this is not a problem in newer versions of ZeroClipboard. @pkbarbiedoll cannot upgrade due to needing the [half-baked] rich clipboard support that 1.0.7. We will get that functionality back in when we revisit #22.

@iam1980

Just confirming the bug for the following configuration:

FF 19.0.1 / Win 8 64bit / zeroclipboard v1.1.7

FYI this is a snippet I'm using to disable the "complete" callback on FF18 & FF19

<script language="JavaScript">

    var enableZC = true;
    var is_firefox18 = navigator.userAgent.toLowerCase().indexOf('firefox/18') > -1;
    var is_firefox19 = navigator.userAgent.toLowerCase().indexOf('firefox/19') > -1;

    if (is_firefox18 || is_firefox19) enableZC = false;

    var clip = new ZeroClipboard();
    clip.glue( $(".api_ctc_buttons") );

    if(enableZC){
        clip.on( 'complete', function ( client, args ) {
            alert("Copied text to clipboard: " + args.text );
        } );
    }

</script>
@pkbarbiedoll

@iam1980 - can you follow up with the Mozilla bugtracker with this data? If possible put together a self-contained, functional & simple test case for them to work with, showing the problem.

Mozilla assumes this issue only affects ZC 1.0.7. It will be useful for them to see it happen with the newer version of ZC.

https://bugzilla.mozilla.org/show_bug.cgi?id=829557

@pkbarbiedoll

It appears Mozilla fixed the bug in Firefox 22, scheduled for release in March 2013.

Status: NEW → RESOLVED
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Flags: in-testsuite+
Last Resolved: 2013-03-04 14:17:58 
@iam1980

Nice. We just need to remember to test it once released.

@JamesMGreene
ZeroClipboard member

FYI, Mozilla is going to attempt to backport the fix into Firefox 20.

@JamesMGreene
ZeroClipboard member

Update:

  • Firefox 21: Fix was successfully applied
  • Firefox 20: Fix did not apply cleanly (at least not yet)
@pkbarbiedoll

From Mozilla:

Tested using the STR in comment 12.
The copied result is rendered HTML without any freeze/hang.
Verified fixed Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20130305
Firefox/22.0

Now we wait for the RC.

@JamesMGreene
ZeroClipboard member

Now fixed in Firefox 20 as well, which should be released on 2013-04-01. Woohoo!

@pkbarbiedoll

Confirming that the Mozilla patch corrects the problem with ZeroClipboard 1.0.7 freezing. Tested with FF20 and FF21 in XP and Win7.

Now we wait for the HTML rendering issue to be looked at in ZC 1.1.x. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment