I\'m writing a Google Chrome extension which manipulates the current page (basically adds a button).
In my content script, I want to load the Facebook Graph API:
Google Chrome extensions no longer allow injecting external code directly, however you can still download the code with an Ajax call and feed it to the injector as if it was a code block.
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
$.get("http://127.0.0.1:8000/static/plugin/somesite.js", function(result) {
chrome.tabs.executeScript(tabs[0].id, {code: result});
}, "text");
});
source: https://stackoverflow.com/a/36645710/720665