[Greasemonkey] Greasemonkey 0.4 attempt II

John gm at plsek.id.au
Wed Jul 6 13:50:50 EDT 2005


Aaron Boodman wrote:

>* fixed pref namespace double-slash bug that was brought up
>  
>
Not sure about that! Now you are forcing a double-slash in all cases.
 From memory, the "root" of prefs in 0.3.3 was created as follows

this.prefMan = new GM_PrefManager(["scriptvals.",
                                     namespace,
                                     "/",
                                     script.name,
                                     "."].join(""));

In the first 0.4, you changed that to

  if (namespace.substring(namespace.length - 1) != "/") {
    namespace += "/";
  }
  
  this.prefMan = new GM_PrefManager(["scriptvals.",
                                     namespace,
                                     script.name,
                                     "."].join(""));
}

thereby, eliminating the double-slash in the case of a namespace already ending in a slash (which was my problem)

NOW, you've changed it to,

  if (namespace.substring(namespace.length - 1) != "/") {
    namespace += "/";
  }
  
  this.prefMan = new GM_PrefManager(["scriptvals.",
                                     namespace,
                                     "/",
                                     script.name,
                                     "."].join(""));
}

Which forces double-slash, which will break MORE scripts than eliminating double-slash, I suspect


John





More information about the Greasemonkey mailing list