diff --git a/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm b/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm index c7c155e7e24..d8246feda4c 100644 --- a/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm +++ b/toolkit/components/osfile/modules/osfile_shared_allthreads.jsm @@ -108,7 +108,7 @@ exports.defineLazyGetter = defineLazyGetter; * The choice of logger can be overridden with Config.TEST. */ let gLogger; -if (typeof console != "undefined" && console.log) { +if (typeof window != "undefined" && window.console && console.log) { gLogger = console.log.bind(console, "OS"); } else { gLogger = function(...args) {