I am working with chrome extension. I want to create a function in my current content.js, then add the function to another.js file
I have created a new script in content.js using this code:
var s = document.createElement('script');
s.src = chrome.runtime.getURL('another.js');
(document.head || document.documentElement).appendChild(s);
(I have another.js in the same directory)
Now, if I am in content.js, is there a way to create a new function myfunction() and add it to another.js file (from content.js) ??