> 1) Does functionality like this already exist in chrome, or via an
> extension?

No, this functionality does not exist for Chrome and there is no extension I
have seen that modifies Chrome's Find behavior (for reasons that will become
obvious once I address the next question).

> 2) Is it possible to use the existing find bar, or do I need to roll
> my own in DOM?

We currently do not have any extension API that allows you to modify/use the
existing Find bar nor initiate/modify searches in Chrome. There is also no
such extension API in development at the moment, but that's not to say we
won't add one at some point.


On Sat, Sep 19, 2009 at 16:38, Neal Kanodia <[email protected]> wrote:

>
> I'm looking into creating an extension that acts like the find bar,
> but only searches link.  (Like FireFox's Quick Find (links only))
>
> It seems possible, but my current implementation is clunky.
> Questions:
>
> 1) Does functionality like this already exist in chrome, or via an
> extension?
>
> 2) Is it possible to use the existing find bar, or do I need to roll
> my own in DOM?
>
> 3) I want to use the same shortcut key as FireFox (').  However, my
> current implementation is a bit yucky because it captures apostrophes
> in cases where it's incorrect (e.g, typing in a text box, or if the
> root page is already handling apostrophe).  Right now I'm using
> onkeypress on document.
>
> Any suggestions on how to be aware if no other handler has responded
> to the key?  Ignoring textarea/input is okay, but I would prefer if I
> could exclude all keypresses if the webpage has already bound to
> apostrophe.
>
>
> The shell of my code (just the custom find bar, no find behavior):
> ===
>
> var CODE_ESCAPE = 27;
> var CODE_APOSTROPHE = 39;
> var SEARCH_BOX = '<div id="linkfind_div"
> style="display:none;position:absolute;top:0;right:0;"><input
> type=text></div>'
>
>
> function hide() {
>  if (!enabled) return;
>  enabled = false;
>
>  $(document).keypress(showOnApos);
>  $('#linkfind_div').hide();
> }
>
>
> function show() {
>  if (enabled) return;
>  enabled = true;
>
>  $(document).unbind('keypress', showOnApos);
>  $('#linkfind_div').show();
>  $('#linkfind_div input').focus();
> }
>
>
> function showOnApos(event) {
>  if (event.keyCode == CODE_APOSTROPHE) {
>    show();
>  }
> }
>
>
> function hideOnEsc(event) {
>  if (event.keyCode == CODE_ESCAPE) {
>    hide();
>  }
> }
>
>
> // main entry point
> var enabled = false;
> var searchBox = null;
> $('body').append(SEARCH_BOX);
> $('#linkfind_div input').blur(hide);
> $('#linkfind_div input').keyup(hideOnEsc);
> $(document).keypress(showOnApos);
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to