Created
March 28, 2018 08:22
-
-
Save josemmo/7b31778adafd2b49285d85d2bd54f90c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extensiones instaladas en Google Chrome | |
fp_sources.extensions = {}; | |
var exposed_resources = [ | |
['chrome-extension://.../f1.png', 'AdBlock'], | |
['chrome-extension://.../f2.png', 'Ghostery'], | |
['chrome-extension://.../f3.png', 'WOT'] | |
]; | |
var checkChromeExtension = function(i) { | |
if (i < exposed_resources.length) { | |
var ex = exposed_resources[i]; | |
var dummy = new Image(); | |
dummy.src = ex[0]; | |
dummy.onload = function() { | |
fp_sources.extensions[ex[1]] = true; | |
checkChromeExtension(i+1); | |
}; | |
dummy.onerror = function() { | |
fp_sources.extensions[ex[1]] = false; | |
checkChromeExtension(i+1); | |
}; | |
} else { | |
// Hemos terminado la detección, | |
// aquí continuaría nuestro script | |
} | |
}; | |
// Iniciamos la ejecución asíncrona del script | |
checkChromeExtension(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment