Page 1 of 1

Pass selected text to site?

Posted: Sun Dec 12, 2010 10:07 pm
by dskoe
Can flagfox pass selected text to a site such as google translate or Oxford English Dictionary?
Thanks...

Re: Pass selected text to site?

Posted: Mon Dec 13, 2010 1:45 am
by DaveG
You mean a selection of text in the current page? No, right now it can't, but now that you mention it I see how that could be useful.

You could probably hack something together using the new JavaScript action capabilities in Flagfox 4.1, but it might be simple to add a placeholder to send selected text. I'll look into it.

Re: Pass selected text to site?

Posted: Mon Dec 13, 2010 2:19 am
by DaveG
On further investigation and thought, I don't think I want to add a placeholder for this as it's not a static piece of data in or for the page like the other placeholders. It changes based on the user's selection, and it the API to get it seems to return messy strings sometimes. Using Flagfox 4.1a4+ you can however do it manually with a JavaScript action:

javascript:{openURL("http://translate.google.com/#auto|{locale-os}|"+window.getSelection().toString())}

Again, this won't work in Flagfox 4.0.x as it uses features new to Flagfox 4.1 development versions.