"Google Instant" stealing focus // use Surrogate Script ?

Ask for help about NoScript, no registration needed to post

"Google Instant" stealing focus // use Surrogate Script ?

Postby new_7 » Fri Sep 10, 2010 2:54 pm

Hello there!

As of today, "google instant" launched in my browser. The problem I have: it's stealing the focus into its search box and making my current and desired "keyconfig" & "surfkeys" extensions' configurations impossible to use: viz, navigating between tabs with a single key stroke ("u" and "o", for instance).

Google (who else...) returned the following:

viewtopic.php?f=7&t=4301
and
http://forums.mozillazine.org/viewtopic ... &t=1801495

I thought I'd start a new post for this, because "google instant" is still quite new.

My initial plan was to write / edit the user.js (or pref.js / prefs.js) file, but then found the above noscript approach (which I would prefer), but trying to implement it, ie, creating two new strings in about:config with this

Code: Select all
"noscript.surrogate.nofocus.sources", "www.google.com");
"noscript.surrogate.nofocus.replacement", "HTMLInputElement.prototype.focus=function(){}"


didn't (yet) do the trick for me. Why?

Thanks!
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)
new_7
 
Posts: 2
Joined: Fri Sep 10, 2010 2:33 pm

Re: "Google Instant" stealing focus // use Surrogate Script

Postby Giorgio Maone » Fri Sep 10, 2010 3:15 pm

new_7 wrote:didn't (yet) do the trick for me. Why?

This is a page surrogate (to be executed before the page starts to be parsed), therefore its site pattern must be introduced by "@":
Code: Select all
user_pref("noscript.surrogate.nofocus.sources", "@www.google.com");
user_pref("noscript.surrogate.nofocus.replacement", "HTMLInputElement.prototype.focus=function(){}"
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
User avatar
Giorgio Maone
Site Admin
 
Posts: 7325
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: "Google Instant" stealing focus // use Surrogate Script

Postby new_7 » Fri Sep 10, 2010 3:22 pm

I feel I'm in very good hands again... :D

and suppose the problem is virtually solved.

One question:

Code: Select all
@.www.google.com

or

Code: Select all
@www.google.com


@. vs @

Does the former include subdomains, too, or is one of the two simply wrong, or does it not matter (whether one includes the dot or not)?

Many thanks, Giorgio!

ps: just tried the @ version: works! :D
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)
new_7
 
Posts: 2
Joined: Fri Sep 10, 2010 2:33 pm

Re: "Google Instant" stealing focus // use Surrogate Script

Postby Giorgio Maone » Fri Sep 10, 2010 6:25 pm

google.com matches just google.com
.google.com matches google.com, www.google.com, mail.google.com, any.sub.domain.google.com and so on.
*.google.com matches the above but not google.com.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
User avatar
Giorgio Maone
Site Admin
 
Posts: 7325
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy


Return to NoScript Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests