I am unable to load jquery into my safari extensions injected script
Below is my injected script injected.js and the alert is never fired. typeof(jQuery) returns undefined. I even tried adding the script as a "script" node in document.head and nothing is working. My global html file is basically an empty file. I tried some of the suggestion mentioned in the other thread too.
document.addEventListener("mouseup", handleSelectedText, false);
element = document.createElement('bubble');
element.id = 'P';
element.appendChild(document.createElement('googlesearch'));
element.style.display = 'none';
document.body.insertBefore(element, document.body.firstChild);
if($(document))
{
alert('js laoded');
}
Works for me. Did you remember to grant your extension access to at least some websites? That setting is in the Extension Builder too: