Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

global leaks in Chrome and Firefox #695

Closed
hunterloftis opened this Issue Dec 28, 2012 · 4 comments

Comments

Projects
None yet
4 participants

Tests that pass in Safari and iOS fail in Chrome and Firefox with 'global leak detected.'

  • Chrome 23.0.1271.101.
  • FF 17.0.1.
  • Mocha 1.7.4, browser build.
  • Safari 6.0.2

Chrome error:

Error: global leak detected: __screenCapturePageContext__
    at Runner.checkGlobals (http://skookum.github.com/s4client/vendor/mocha.js:3907:21)
    at Runner.<anonymous> (http://skookum.github.com/s4client/vendor/mocha.js:3794:44)
    at Runner.EventEmitter.emit (http://skookum.github.com/s4client/vendor/mocha.js:235:20)
    at http://skookum.github.com/s4client/vendor/mocha.js:4138:14
    at done (http://skookum.github.com/s4client/vendor/mocha.js:3700:5)
    at http://skookum.github.com/s4client/vendor/mocha.js:3712:9
    at onAccount (http://skookum.github.com/s4client/test/test.accounts.js:29:16)
    at onAccount (http://skookum.github.com/s4client/src/status4.js:59:39)
    at ajaxSuccess (http://skookum.github.com/s4client/vendor/zepto.js:1010:22)
    at XMLHttpRequest.xhr.onreadystatechange (http://skookum.github.com/s4client/vendor/zepto.js:1165:16)

Firefox error:

global leaks detected: console, getInterface
Runner.checkGlobals@http://skookum.github.com/s4client/vendor/mocha.js:3905
Runner/<@http://skookum.github.com/s4client/vendor/mocha.js:3794
EventEmitter.emit@http://skookum.github.com/s4client/vendor/mocha.js:235
Runner.runTests/next/</<@http://skookum.github.com/s4client/vendor/mocha.js:4138
done@http://skookum.github.com/s4client/vendor/mocha.js:3700
Runnable.run/<@http://skookum.github.com/s4client/vendor/mocha.js:3712
onAccount@http://skookum.github.com/s4client/test/test.accounts.js:29
onAccount@http://skookum.github.com/s4client/src/status4.js:59
ajaxSuccess@http://skookum.github.com/s4client/vendor/zepto.js:1010
$.ajax/xhr.onreadystatechange@http://skookum.github.com/s4client/vendor/zepto.js:1165
Contributor

tj commented Jan 1, 2013

hmm chrome and safari are fine for me ( same versions ), maybe something is doing a console noop so they can do console.log() etc unconditionally

jcsrb commented Mar 20, 2013

for the Chrome one the extension Screen Capture is at fault.

Either

  • Uninstall the extension
  • Use Incognito mode to run test , and set the extension not to run in incognito mode
Contributor

tj commented Mar 26, 2013

im thinking we should maybe disable global leak checks by default, seems like a lot of weird edge-cases

Contributor

danielstjules commented Mar 9, 2015

Closing since the issue was caused by browser plugins polluting the global namespace, and global detection has been disabled by default (as per tj's suggestion). Global detection is opt-in using mocha.checkLeaks();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment