move to es5 getter usage for csp service
This commit is contained in:
parent
80b5009a73
commit
30eb00a29b
|
@ -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);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue