Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14728 > unrolled thread

Quick Search in Firefox: can I trigger from Javascript?

Started byEli the Bearded <*@eli.users.panix.com>
First post2012-06-27 21:58 +0000
Last post2012-07-09 18:39 -0700
Articles 6 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  Quick Search in Firefox: can I trigger from Javascript? Eli the Bearded <*@eli.users.panix.com> - 2012-06-27 21:58 +0000
    Re: Quick Search in Firefox: can I trigger from Javascript? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-06-29 11:57 -0700
      Re: Quick Search in Firefox: can I trigger from Javascript? Eli the Bearded <*@eli.users.panix.com> - 2012-07-09 18:25 +0000
        Re: Quick Search in Firefox: can I trigger from Javascript? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-07-09 14:44 -0700
          Re: Quick Search in Firefox: can I trigger from Javascript? Eli the Bearded <*@eli.users.panix.com> - 2012-07-09 22:09 +0000
            Re: Quick Search in Firefox: can I trigger from Javascript? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-07-09 18:39 -0700

#14728 — Quick Search in Firefox: can I trigger from Javascript?

FromEli the Bearded <*@eli.users.panix.com>
Date2012-06-27 21:58 +0000
SubjectQuick Search in Firefox: can I trigger from Javascript?
Message-ID<eli$1206271751@qz.little-neck.ny.us>
Firefox, at least as I have it configured, lets you start search within
a web page by typing "/" to bring up a "Quick Search" bar. Is there
some way I can invoke that on my own? I'm thinking of something along
the lines of:

...
	<script type="text/javascript">
	function QuickFind(event) {
	  var keycode;
	  if(event.which) {
	    keycode = event.which;
	    // 27 == escape
	    if(keycode == 27) {
	      InvokeQuickSearch();
	    }
	  }
	}
	</script>
...
	<body onkeydown="QuickFind(event)">
...

Elijah
------
doesn't know where to being searching for Firefox internal functions

[toc] | [next] | [standalone]


#14770

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2012-06-29 11:57 -0700
Message-ID<030d8fad-d328-4d31-8fd1-5ccccb89ff53@googlegroups.com>
In reply to#14728
On Wednesday, June 27, 2012 4:58:39 PM UTC-5, Eli the Bearded wrote:
> Firefox, at least as I have it configured, lets you start search within
> a web page by typing "/" to bring up a "Quick Search" bar. Is there
> some way I can invoke that on my own? I'm thinking of something along
> the lines of:
> 
> ...
> 	<script type="text/javascript">
> 	function QuickFind(event) {
> 	  var keycode;
> 	  if(event.which) {
> 	    keycode = event.which;
> 	    // 27 == escape
> 	    if(keycode == 27) {
> 	      InvokeQuickSearch();
> 	    }
> 	  }
> 	}
> 	</script>
> ...
> 	<body onkeydown="QuickFind(event)">
> ...
> 
> Elijah
> ------
> doesn't know where to being searching for Firefox internal functions

Look at this:
<https://developer.mozilla.org/en/DOM/window.find>

[toc] | [prev] | [next] | [standalone]


#14974

FromEli the Bearded <*@eli.users.panix.com>
Date2012-07-09 18:25 +0000
Message-ID<eli$1207091425@qz.little-neck.ny.us>
In reply to#14770
In comp.lang.javascript, Michael Haufe (TNO) <tno@thenewobjective.com> wrote:
> On Wednesday, June 27, 2012 4:58:39 PM UTC-5, Eli the Bearded wrote:
>> Firefox, at least as I have it configured, lets you start search within
>> a web page by typing "/" to bring up a "Quick Search" bar. Is there
>> some way I can invoke that on my own? I'm thinking of something along
>> the lines of:
> Look at this:
> <https://developer.mozilla.org/en/DOM/window.find>

The window.find function could be used to write my own, but not use
the existing one in Firefox. I downloaded the source to 13.0.1 and have
started poking through it. It looks like I want cmd_findTypeText() from
XPCOMUtils.jsm, but if I try to import that module:

Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
...
cmd_findTypeText();

I get an error on the "Web Console":

[10:34:37.142] Permission denied for <http://172.24.1.100> to get property XPCComponents.utils @ http://172.24.1.100/testing/keystroke.html:13

So is this just going to be impossible for me with the permissions
model of Firefox?

Elijah
------
"find | grep" worked out so much easier than google searches

[toc] | [prev] | [next] | [standalone]


#14980

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2012-07-09 14:44 -0700
Message-ID<d220c4cd-3897-4971-8496-465f5345e142@h20g2000yqe.googlegroups.com>
In reply to#14974
On Jul 9, 1:25 pm, Eli the Bearded <*...@eli.users.panix.com> wrote:
> In comp.lang.javascript, Michael Haufe (TNO) <t...@thenewobjective.com> wrote:
>
> > On Wednesday, June 27, 2012 4:58:39 PM UTC-5, Eli the Bearded wrote:
> >> Firefox, at least as I have it configured, lets you start search within
> >> a web page by typing "/" to bring up a "Quick Search" bar. Is there
> >> some way I can invoke that on my own? I'm thinking of something along
> >> the lines of:
> > Look at this:
> > <https://developer.mozilla.org/en/DOM/window.find>
>
> The window.find function could be used to write my own, but not use
> the existing one in Firefox. I downloaded the source to 13.0.1 and have
> started poking through it. It looks like I want cmd_findTypeText() from
> XPCOMUtils.jsm, but if I try to import that module:
>
> Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
> ...
> cmd_findTypeText();
>
> I get an error on the "Web Console":
>
> [10:34:37.142] Permission denied for <http://172.24.1.100> to get property XPCComponents.utils @http://172.24.1.100/testing/keystroke.html:13
>
> So is this just going to be impossible for me with the permissions
> model of Firefox?


So it is probably safe to say you aren't writing an add-on? No, I do
not believe it will be possible to control the chrome of the browser
from a standard webpage.

[toc] | [prev] | [next] | [standalone]


#14981

FromEli the Bearded <*@eli.users.panix.com>
Date2012-07-09 22:09 +0000
Message-ID<eli$1207091809@qz.little-neck.ny.us>
In reply to#14980
In comp.lang.javascript, Michael Haufe (TNO) <tno@thenewobjective.com> wrote:
> On Jul 9, 1:25 pm, Eli the Bearded <*...@eli.users.panix.com> wrote:
> > I get an error on the "Web Console":
> > [10:34:37.142] Permission denied for <http://172.24.1.100> to get
> property XPCComponents.utils
> @http://172.24.1.100/testing/keystroke.html:13
> > So is this just going to be impossible for me with the permissions
> > model of Firefox?
> So it is probably safe to say you aren't writing an add-on? No, I do
> not believe it will be possible to control the chrome of the browser
> from a standard webpage.

The ultimate goal was a Greasemonkey script, but I have been playing
with a boring webpage to start.

Elijah
------
wanted to avoid writing an add-on

[toc] | [prev] | [next] | [standalone]


#14985

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2012-07-09 18:39 -0700
Message-ID<70a29b50-afd2-4155-871b-3d718e38d236@a8g2000vbk.googlegroups.com>
In reply to#14981
On Jul 9, 5:09 pm, Eli the Bearded <*...@eli.users.panix.com> wrote:
> In comp.lang.javascript, Michael Haufe (TNO) <t...@thenewobjective.com> wrote:
>
> > On Jul 9, 1:25 pm, Eli the Bearded <*...@eli.users.panix.com> wrote:
> > > I get an error on the "Web Console":
> > > [10:34:37.142] Permission denied for <http://172.24.1.100> to get
> > property XPCComponents.utils
> > @http://172.24.1.100/testing/keystroke.html:13
> > > So is this just going to be impossible for me with the permissions
> > > model of Firefox?
> > So it is probably safe to say you aren't writing an add-on? No, I do
> > not believe it will be possible to control the chrome of the browser
> > from a standard webpage.
>
> The ultimate goal was a Greasemonkey script, but I have been playing
> with a boring webpage to start.
>
> Elijah
> ------
> wanted to avoid writing an add-on

I found the following regarding GM privileges:

<http://wiki.greasespot.net/
FAQ#Do_Greasemonkey_scripts_have_chrome_privileges.3F>
<http://wiki.greasespot.net/API_reference>

It seems you'll have to go whole hog and create an add-on (Jetpack
perhaps?), or just emulate with window.find

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web