I was asked to display a pop-up to the user if he has at least 1 out of 5 extensions.
The extensions are: adblock plus
,adBlock
,Disconnect
and etc...
I am not familiar with all the extensions and their affect on the DOM (except for adblock plus
) so I am looking for a function that will check by the extension id if it exist in the browser?
I tried:
var detect = function(base, if_installed, if_not_installed) {
var s = document.createElement('script');
s.onerror = if_not_installed;
s.onload = if_installed;
document.body.appendChild(s);
s.src = base + '/manifest.json';
}
detect('chrome-extension://' + 'gcbommkclmclpchllfjekcdonpmejbdp', function() {alert('boom!');});
Which I got from:http://blog.kotowicz.net/2012/02/intro-to-chrome-addons-hacking.html, He says it works, but I got this error:
Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.