(This question is actually not related to redactor at all. It could be applied to anything: JQuery, CodeMirror, etc.)
I would like to create a chrome extension to change text inside redactor-editor. If I open the console, I could type:
$("#editor").redactor("code.set", "<p>foo bar</p>")
and this will give me what I want.
Now, I write an extension to do this. However, it seems that redactor couldn't be accessed from the content script. This is not surprising, as it's documented that Chrome extensions are working in an isolated world (in fact, I think my JQuery and the site's JQuery wouldn't even be the same). However, I also know that there is a hack to do this; that is, to append a script tag which runs that command to the DOM. After doing that, however, I still get the error.
Uncaught TypeError: $(...).redactor is not a function
Do you have any idea on how I can access redactor?