1
0
Fork 0
This repository has been archived on 2024-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
matomo-injector/js/run.js

21 lines
529 B
JavaScript
Raw Normal View History

(function() {
function injectScript(src, where) {
var elm = document.createElement('script');
elm.src = src;
document[where || 'head'].appendChild(elm);
}
2014-05-12 11:22:21 +02:00
var website = location.protocol + '//' + location.host;
chrome.storage.sync.get(website, function(obj) {
var customjs = obj[website];
2017-08-25 22:50:13 +02:00
if (customjs && customjs.config.enable) {
// Script
if (customjs.source) {
setTimeout(function() {
injectScript(customjs.source, 'body');
}, 250);
}
2014-05-07 13:56:35 +02:00
}
});
2014-05-12 11:22:21 +02:00
})();