Chrome2Phone Hack – Sending arbitrary text

I use KeePass on my PC and KeePassDroid on my Android phone to manage the hundreds of unique passwords for all the sites and services I use. I keep the password database synced using Dropbox on both PC and Android.

I also use Google’s Chrome browser. The Chrome2Phone (C2P) extension is a great way for me to throw links, phone numbers, maps and other info to my phone from the web browser.

Logging into sites and services on the phone can be a pain because of the complexity of the random passwords I use. KeePassDroid is a bit of a speed bump. It occurred to me that I might be able to send a password to my phone’s clipboard using C2P. Ideally, I’d write a plugin for KeePass that could do what C2P does, but I came up with something else.

C2P supports sending text you highlight in a web page to your phone’s clipboard for pasting. If I could get my password into a web page on my PC, I could send it to the phone. I noticed that if I’m on a web page with a textbox, I can paste arbitrary text (like a password) into the textbox, highlight it, right click it, and send it to the phone. I’m security conscious enough to not want to go pasting my passwords into random textboxes hosted on sites I don’t control. With all the javascript flying around out there, the owner of the page could easily grab whatever I put in the textbox and save it for later perusal.  (We’ll set aside the question for now of, “Do you trust C2P enough to use it to send passwords?”)

What I needed was a single text box in a web page that I control and trust. I made the page, saved it on my hard disk, and launched it in a browser. Here’s that file:
<!DOCTYPE html>
<title>Chrome2Phone Hack</title>
<input type="text"/>

But C2P didn’t like the fact that the page was served locally, off my hard disk, and not from a web server.  It refused to show me the standard C2P options in the right-click context menu. Perhaps I’ll suggest a patch to C2P for this in the future. But for now…

I dragged the HTML file to the Public folder of my Dropbox account, right clicked it, and via the Dropbox context menu, got a public link for it. I’ll let Dropbox host my simple page so that C2P will work. I created a bookmark in my Chrome toolbar named “C2PHack”.

Now whenever I need to send arbitrary info to my phone, I can click my bookmark, paste my text into the textbox, highlight it, and send it to the phone.

Easy, right?


Published by

Larry Silverman

Larry Silverman is a father and husband, software developer, small-business owner, DIY tinkerer, occasional musician, continuous learner, free thinker, despiser of yard work and comma abuser.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s