topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 10, 2024, 9:08 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Firefox 3 Searches Alias (Related to Firefox 3 Smart Keywords)  (Read 5557 times)

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Firefox 3 Searches Alias

  • Short Introduction
    This alias allows you to reuse your Firefox "Smart Keyword" searches from within FARR.

    For example, you might configure a Smart Keyword using the keyword "dc" to search the donationcoder forums.  To perform this search in Firefox, in its location bar one might type:

      dc weekly news

    With this alias, you can initiate a similar search from within FARR, (even when Firefox is not running), in its search edit box one might type:

      fs3 dc:weekly news

    In addition, with FARR's non-contiguous matching enabled, you don't even have to remember the "dc" keyword.  If you can type a portion of the website's name, FARR can filter potential candidate searches for you.

    (Feel free to skip the next section "Introduction for the Patient" if you felt you got the basic idea.  I recommend looking at the "Quick Start" section before deciding what to look at afterwards.)

  • Introduction for the Patient
    According to Wikipedia's article on "Features of Mozilla Firefox":

      Smart keywords can be used to quickly search for information on
      specific Web sites.  A smart keyword is defined by the user and can
      be associated with any bookmark, and can then be used in the
      location bar as a shortcut to quickly get to the site or, if the
      smart keyword is linked to a searchbox, to search the site.

    A major aim of this alias is to enable FARR to reuse the core functionality provided by features such as "Smart Keywords" [1].

    Using this alias, a user should be able to quickly search a site via FARR, leveraging Firefox's store of search information, but perhaps in a manner that is more convenient than in Firefox.

    Once the alias has been configured, one might type:

      f3s donatcode:cranioscopical                                  (1)

    or perhaps:

      f3s dc:cranioscopical                                             (2)

    or even:

      f3s doooom:cranioscopical                                      (3)

    in FARR's search edit box to search for "cranioscopical" at the DonationCoder forums.

    If one were using smart keywords, the properties dialog box for the bookmark might have the following fields and values:

      Name: DonationCoder Forums
      Location: https://www.donation...search&search=%s
      Keyword: dc

    Invocations (1) and (3) depend on FARR's non-contiguous matching [2], while invocation (2) might work due to the associated keyword (or also the non-contiguous matching).

    [1] For more information on "Smart Keywords", please consider:

          https://secure.wikimedia.org/wikipedia/en/wiki/Features_of_Mozilla_Firefox#Smart_Keywords
          http://kb.mozillazine.org/Using_keyword_searches
          https://support.mozilla.com/en-US/kb/Smart+Keywords

    [2] In FARR's Options dialog, under Program Options -> Settings -> Search
        Behavior -> Non-contiguous Pattern Matching, there is a setting for:

          Score non-contiguous matches

        This alias may be more convenient if the associated checkbox for
        this setting is checked.

        In addition, it may be that the alias' behavior is affected by the
        checkbox for the setting immediately beneath:

          Disable non-contiguous matching when using +sall to show all matches

        This remains to be determined :)

  • Quick Start
    Please note that below, lines prefixed by >>> are intended as actions.  You may be able to read just those lines and manage to get things working.  The rest of the text is for the cases where that doesn't work out.

    The current approach is meant as a proof-of-concept.  Unfortunately, it has some drawbacks (including but not necessarily limited to):

      -Initial configuration is necessary.  The process used in this
       approach depends on knowing where one's Firefox data (profile
       directory) is and determining this automatically does not appear to
       be so simple.  As of this writing, no automatic method has been
       implemented.
      
      -Periodic manual execution of a utility is necessary to update
       alias information if relevant Firefox data changes.

    If that doesn't bother you or you want to try anyway, please continue :)

  • Installation and Configuration
    The actions in this section include: confirmation, modification, execution of a utility, and informing FARR of changes.

    >>> Confirm that the folder containing the README.txt from the unpacked archive is located in:
    >>>
    >>>   Windows XP: <FARR-Installation-Dir>\AliasGroups\Installed\FF3Searches
    >>>   Vista / 7: Good question -- someone care to help me out on this? :)

    where <FARR-Installation-Dir> is typically (but not necessarily):

      C:\Program Files\FindAndRunRobot

    >>> Appropriately specify values in ExtractFF3Searches.ini

    A starting template is provided in ExtractFFSearches.ini.blank.  Copying it and modifying the result is recommended.  Its content is:

      [Settings]
      ProfileDir=
      Debug=0

    The important value is the one that specifies your Firefox profile directory.  This is named ProfileDir.

    Typical values of ProfileDir may look like (but are not likely to be exactly the same as):

      C:\Documents and Settings\rolfs\Application Data\Mozilla\Firefox\Profiles\p314e21.default
      C:\Users\carlh\AppData\Roaming\Mozilla\Firefox\Profiles\z80x486.default
      X:\Apps\FirefoxPortable\Data\profile
      
    If you don't know what value to use, the following might be of some use in making a determination:

      http://support.mozilla.com/en-US/kb/Profiles
      http://kb.mozillazine.org/Profile_folder_-_Firefox#Finding_the_profile_folder

    Debug should be 0 (off) or 1 (on).  If Debug is 1, the extraction utility (ExtractFFSearches.exe) may provide more diagnostic information than otherwise via dialog boxen and a file named debuglog.txt.

    Once ExtractFF3Searches.ini has been appropriately modified:

    >>> Run ExtractFF3Searches.exe to generate FF3Searches.txt

    Successful execution should result in the creation of a file named FF3Searches.txt.  If you've used FARR aliases before, the content of this file might look familiar.  It is analogous to what you might put in the "Result(s)" text area of the "Edit Group Alias" dialog box in FARR.

    To make FARR aware of the Firefox 3 Searches alias, either restart FARR or:

    >>> Bring up FARR and type: goreload

    Note that there may be a discrepancy between what is in FF3Searches.txt and the most up-to-date information maintained by Firefox.  See the Notes section below for some more detail.

  • Example Usage
    To search Stack Overflow for FARR:

    >>> Bring up FARR and type f3s so:FARR

    One way to analyze what is typed is:

      f3s
        the name of the alias
      <space-character>
        a separator between the alias and the rest
      so
        a string that matches a name/title (Stack Overflow)
      :
        a separator indicating that query terms are about to follow
      FARR
        the query text

    Note the colon character between "so" and "FARR".

    To search Firefox Add-ons for greasemonkey:

    >>> Bring up FARR and type f3s ffa:greasemonkey

    One way to analyze what is typed is:

      f3s
        the name of the alias
      <space-character>
        a separator between the alias and the rest
      ffa
        a string that matches a name/title (Firefox Add-ons)
      :
        a separator indicating that query terms are about to follow
      greasemonkey
        the query text

    Did I mention that there's a colon?  ;)

    The usage of this alias is very similar to that of another one named "SokuGin".  The latter's documentation may be nicer, so it's possible that taking a look might be helpful:

      https://www.donationcoder.com/forum/index.php?topic=15904.0

  • Notes
    -There is an alias for rebuilding FF3Searches.txt -- it is f3sx

    -There is an alias for viewing content similar to what's here -- it is f3sreadme

    -Values in ExtractFF3Searches.ini, should be specifiable using
     environment variables such as %APPDATA%.

    -ExtractFF3Searches.exe may be run with command line arguments (the
     values override any values in the .ini file).  A value for ProfileDir
     may be specified and optionally -v which is equivalent to Debug=1.

    -The extraction utility analyzes daily backups of bookmarks that
     Firefox creates.  The extracted information may be out-of-date
     because the backups are too.  The most up-to-date information is
     stored in a file which Firefox locks while it is running in a manner
     that appears to prevent other programs from accessing it.

     I presume many people often have Firefox running, so I looked for
     another way to access information which might often be comparably
     good.  For more details, please read the following posts:
     
       https://www.donation....msg195345#msg195345
       https//www.donationcoder.com/forum/index.php?topic=18615.msg195489#msg195489

     One work-around is to wait 24 hours and extract again.

     Another might be to use the Backup functionality via Firefox's
     Organize Bookmarks window (though, I've found the latter to be
     somewhat, delayed (may be?) in opeartion).

     A longer-term work-around might be to convince Firefox developers to
     make bookmark data more readily accessible -- preferably without
     users having to install anything additional or make any configuration
     changes :)

     I wasn't keen on copying the locked file to another location and then
     accessing it.  Perhaps my leanings on this matter might be
     influenced...
      
    -Firefox 3.6 seems to generate invalid JSON -- at least the bookmark
     backups in alleged JSON format are not necssarily strictly JSON.  My
     local copies have trailing commas in places where there should not be
     -- at least, that's my current understanding.  This led me to pass on
     using Douglas Crockford's json_parse.js, sadly.

    -Tested with Firefox 3.6 and FARR 2.86.01 around 2010-03-01 on Windows XP
     SP3.

  • Credits
    Thanks to:

      mouser
        for testing, discussion, etc.
      Jabberwock for writing up his post:
        https://www.donationcoder.com/forum/index.php?topic=18615.0
      lanux128
        for discussion and testing

      erictheturtle
        for ws4ahk
      Mike Samuel
        for json-sans-eval, but:
          source code seems to suggest Public Domain
          web page says Apache License 2.0
          errr, so which is it?

      Douglas Crockford
        for JSON
      Chris Mallet and AHK contributers  
        for AutoHotkey and Related Code
      Firefox developers and users
        for Firefox

      Ok, this list could go on, but let's stop here :)


Download
« Last Edit: March 06, 2010, 06:55 PM by ewemoa »