I'm trying but even though it's proper link, the script fails. Why?
script = document.createElement('script')
script.src = chrome.runtime.getURL("my_file_from_extension.js")
console.log(script.src) // proper usable link
document.body.appendChild(script) // GET chrome-extension://invalid/ net::ERR_FAILED
I pasted "my_file_from_extension.js" into manifest's web_accessible_resources and it solved the issue.