Reputation: 61
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');
}
Upvotes: 1
Views: 1080
Reputation: 61
Solution was I had to restart the browser after I set the script.
Upvotes: 2
Reputation: 2829
Works for me. Did you remember to grant your extension access to at least some websites? That setting is in the Extension Builder too:
Upvotes: 0