I'm using HTML5 Sever Send Event to publish some status of the server. And I'm implementing a chrome extension to track the status, and notify user if needed.
But When I'm trying to create the EventSource object Chrome throws exception "Uncaught Error: SECURITY_ERR: DOM Exception 18"
var tracker = (function(url) {
var source = new EventSource(url);
var onMessage = function(e) {
console.log(e);
}
source.addEventListener('new', onMessage);
return {
source: source,
newMessage: onMessage
};
})('http://localhost:3000/dispatching');
And I do added the url of the server into my extension permissions:
"permissions": [
"http://localhost:3000/",
"tabs"
]
But the permission doesn't really solve the problem! Any idea?