Skip to content

Instantly share code, notes, and snippets.

@vicramon
Created November 28, 2013 18:08
Show Gist options
  • Save vicramon/7696084 to your computer and use it in GitHub Desktop.
Save vicramon/7696084 to your computer and use it in GitHub Desktop.
Vimium Detection
// Detect the Vimium Chrome extension by Evan Hahn (evanhahn.com)
;(function(doc) {
doc.hasVimium = function() {
return doc.getElementsByClassName('vimiumReset').length > 0;
};
doc.onDetectVimium = function(callback, scope) {
scope || (scope = window);
if (doc.hasVimium()) {
callback.call(scope);
}
else {
var interval = setInterval(function() {
if (doc.hasVimium()) {
clearInterval(interval);
callback.call(scope);
}
}, 1000);
}
};
})(document);
document.onDetectVimium(function() {
$('#vimium_warning').show()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment