chrome

Chrome can't cut and paste without breaking things

Blog

"Copying and pasting requires the free Google Drive web app. This lets us access your clipboard so you can cut, copy and paste."

Because THE BROWSER can't? I find this stunning, as even Netscape 1.0 had the ability to cut and paste and it worked *just* *fine.*

Here, let me highlight the text I want to copy, oh, and LOOK! Flower-c works! Hey, I copied it!

WHY I selected the secondary mouse key and thought selecting "Copy URL" was a good thing, I have no idea.

Chrome show IP address

Blog

Oddly, Chrome developer tools don't have a "show IP address" option. I say "oddly" because it is a fundamental check that developers do when checking cached items on round-robin DNS servers.

Anyway, via http://superuser.com/questions/633714/how-to-get-remote-ip-in-google-chrome-browser, the ShowIP address plugin / extension https://chrome.google.com/webstore/detail/showip/agoljmemkbciolpigpabjfkagboolkcj gives you the IP address in both IP4 and IP6. They are shown in the bottom right. Whoo.

Unfortunately, this won't help me for the odd edge cache served asset, unless I load only it, which is a little more annoying, but still completely doable.

I prefer Firefox's display of all of the IP address for each asset of the request. Sometimes I'm not working in Firefox.

Regardless, odd problem solved (and I can close that tab! yay!).

Prevent multiple form submits with jQuery in webkit/chrome

Blog

Okay, so, you don't want to submit a form twice. While there are server side ways to prevent a form from being accepted twice, it's nice to prevent the need with a little client-side prevention, too. Better user experience, as a bonus.

Using jQuery, you could do this:

  $(".class-on-my-submit-button").click(
    function(e) { 
        $(this).attr('disabled', 'disabled');
    }
    );

The problem with this is that the disabled attribute on the button prevents the form from submitting at all in webkit browsers: Chrome and Safari (ref: http://www.google.com/support/forum/p/Chrome/thread?tid=152f74d4890dc84f&hl=en)

Instead, add a class and check for the class' existence to determine if the form should submit or not.

$(".class-around-each-form form").submit(function(e) {
        if ($(this).hasClass('my-disabled-class')) { e.preventDefault(); return false; }
        $(this).addClass('my-disabled-class');
        return true;
        });

I have a div with a class named .class-around-each-form around each form on a particular page, a quirk specific to my set up. You could use $("form").submit(...) also.

Stupid simple and frustrating if you didn't realize its need, or didn't test on all the browsers.