Reputation: 1136
I am developing an addon for Firefox. In a content script file I have the line
angular.element(document.getElementById("angularAppDiv")).scope();
it returns null
. However if I type the same line into the browser console, I get the scope object? Could someone point out what's happening and why?
Upvotes: 0
Views: 74
Reputation: 19130
By default, content scripts loaded by add-ons and scripts loaded by web pages are insulated from each other:
What you could do is to insert this script tag from content script into the page:
document.head.innerHTML = document.head.innerHTML + '<script> console.log(angular.element(document.getElementById("angularAppDiv")).scope());</script>';
Check this link for more info.
Upvotes: 1