i'd set scripts (background.js) as Background in manifest.json
.
and write the code blow to background.js:
var source = new EventSource('http://localhost:8086/test/');
source.addEventListener('ping', function (e) {
var notification = webkitNotifications.createNotification(
'test.png',
'testTitle',
'testContent'
);
notification.show();
}, false);
these code could run correct as normal html page under http://localhost:8086/
, but it doesn't run at all in the Chrome extension.
I've put http://localhost:8086/
into "permissions" of manifest.json.