I just realised that it doesn't work as I expected.
The System.import within the app.js works perfectly, but not within the restricted environment of a chrome extension.
The problem is, that system.js tries to add a script tag to the name which gets restricted by the chrome extension.
doEval = function(source) {
if (!head)
head = document.head || document.body || document.documentElement;
var script = document.createElement('script');
script.text = source;
var onerror = window.onerror;
var e;
window.onerror = function(_e) {
e = _e;
}
head.appendChild(script); <<<<<<<<< chrome extensions doesn't allow appening a script tag to the dom
head.removeChild(script);
window.onerror = onerror;
if (e)
throw e;
}
Error output
==================
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
Solution (not)
==================
There is no way around the google chrome extension restriction. Since system.js needs to inject scripts into dom in order to load then async, i can't see a way to get this work. :-(
I could probably just add the single production ready file, which doesn't need to add more scripts to the dom. Or do you have an idea how I could still use the full power of jspm?
Thank you for your help.
Chris