Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ var DefaultChainable = getNewChainableClass('Chainable');
function getGlobal() {
// Get global context by keyword here to avoid issues with libraries
// that can potentially alter this script's context object.
return testGlobal(typeof global !== 'undefined' && global) ||
testGlobal(typeof window !== 'undefined' && window);
var ret = testGlobal(typeof global !== 'undefined' && global) ||
testGlobal(typeof window !== 'undefined' && window);
if (ret) return ret;
// Firefox / Thunderbird specific
if (typeof Cu != 'undefined' && typeof Cu.getGlobalForObject != 'undefined')
ret = testGlobal(Cu.getGlobalForObject(getGlobal));
return ret;
}

function testGlobal(obj) {
Expand Down