move to es5 getter usage for csp service

This commit is contained in:
Matthew Irish 2018-10-05 21:58:54 -05:00
parent 80b5009a73
commit 30eb00a29b
1 changed files with 4 additions and 4 deletions

View File

@ -12,19 +12,19 @@ export default Service.extend({
connectionViolations: filterBy('events', 'violatedDirective', 'connect-src'), connectionViolations: filterBy('events', 'violatedDirective', 'connect-src'),
attach() { attach() {
this.get('monitor').perform(); this.monitor.perform();
}, },
remove() { remove() {
this.get('monitor').cancelAll(); this.monitor.cancelAll();
}, },
monitor: task(function*() { monitor: task(function*() {
this.get('events').clear(); this.events.clear();
while (true) { while (true) {
let event = yield waitForEvent(window.document, 'securitypolicyviolation'); let event = yield waitForEvent(window.document, 'securitypolicyviolation');
this.get('events').addObject(event); this.events.addObject(event);
} }
}), }),
}); });