SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Build Your Own Firefox Extension book question

    HI
    perhaps it's just that I am not familiar with object notation but the quote from the book "Build Your Own Firefox Extension" which appears on page 32 confuses me. I mean it says you "remember the the defaultfolder" (Quote below) and I do not.The only thing I could see is maybe the author is referring to what appears on page 31 (quote far below)"'prefservice' : Components" So is that it? Is that what is called the folder in object notation? And then wouldn't the name of the folder be "prefservice" not "pref" as it appears in the first quote below in the JavaScript statement "pref('extensions.myextension.showinstatus', true); ." So please will you clear this up for me?

    Quote Originally Posted by from page 32
    You remember how we created a
    defaultsfolder at the start, and inside that we created a script with the same name
    as our extension? Well thatís the default preferences script, and inside that we use
    the pref method to define them. So for example, if we want our showinstatus
    preference to have the default value of true, we would do this:

    pref('extensions.myextension.showinstatus', true);
    Quote Originally Posted by from page 31
    var myextension =
    {
    'prefservice' : Components
    .classes["@mozilla.org/preferences-service;1"]
    .getService(Components.interfaces['nsIPrefService']),
    .
    .
    .
    }

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that it's from a SitePoint book?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2006
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the length of it being 46 pages you might accuse it of being a Sidepoint pamphlet, but it is listed as a book. Here is the Sidepoint link.

  4. #4
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,014
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    MarcMiller, thanks for the link, until I saw this thread I never knew that existed. I downloaded it, and will have a read through it at some point.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  5. #5
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MarcMiller View Post
    HI
    perhaps it's just that I am not familiar with object notation but the quote from the book "Build Your Own Firefox Extension" which appears on page 32 confuses me. I mean it says you "remember the the defaults folder" (Quote below) and I do not.
    Hi Marc,

    it refers to page 5, where you setup the folder structure for the plugin. The defaults folder is one of the folders in the diagram.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •