Skip to content

Commit

Permalink
Missing typo in injector
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Yves NOLEN committed May 27, 2020
1 parent 5781076 commit a972c59
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions injector.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
function injectScript(file, node) {
var th = document.getElementsByTagName(node)[0];
var s = document.createElement('script');
let injectScript = function(file, node) {
let th = document.getElementsByTagName(node)[0];
let s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.setAttribute('src', file);
th.appendChild(s);
}

function checkForSplunk()
let checkForSplunk = function()
{
const metas = document.getElementsByTagName('meta');
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute('name') === "author") {
return metas[i].getAttribute('content') === "Splunk Inc.";
}
}
return False
return false;
};

if(checkForSplunk())
{
injectScript( chrome.extension.getURL('splunk_xml.js'), 'body' );
injectScript( "//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/highlight.min.js", 'body');
}

console.log("Ok module load")
}

0 comments on commit a972c59

Please sign in to comment.