Changeset 631

Show
Ignore:
Timestamp:
01/19/08 20:25:24 (11 months ago)
Author:
boo..@youngpup.net
Message:

Fix a little bug I found in FF 2.0.0.0 -- the filename property can be null in
the places where it should refer to the XPCOM service. I can't seem to coerce it
into being null ever for HTML though, so this seems like an OK fix.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/components/greasemonkey.js

    r628 r631  
    2525    // chrome:// URLs and the greasemonkey.js component's file:// URL. 
    2626    if (2 == stack.language) { 
    27       if ('chrome' != stack.filename.substr(0, 6) && 
    28           gmSvcFilename != stack.filename) { 
     27      // NOTE: In FF 2.0.0.0, I saw that stack.filename can be null for JS/XPCOM 
     28      // services. This didn't happen in FF 2.0.0.11; I'm not sure when it 
     29      // changed. 
     30      if (stack.filename != null &&  
     31          stack.filename != gmSvcFilename && 
     32          stack.filename.substr(0, 6) != 'chrome') { 
    2933        GM_logError(new Error("Greasemonkey access violation: unsafeWindow " + 
    3034                    "cannot call " + apiName + "."));