Make sure events are stopped at the capturing phase, instead of the target phase.

This commit is contained in:
Timothy Guan-tin Chien 2017-05-14 09:49:52 +08:00
Родитель 5c02cf103f
Коммит 6477ecd015
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -4,15 +4,15 @@
Object.defineProperties(document.wrappedJSObject,
{ 'hidden': {value: false}, 'visibilityState': {value: 'visible'} });
document.addEventListener(
window.addEventListener(
'visibilitychange', evt => evt.stopImmediatePropagation(), true);
// Fullscreen API
document.addEventListener('fullscreenchange', evt => {
window.addEventListener('fullscreenchange', evt => {
Object.defineProperties(document.wrappedJSObject,
{ 'fullscreenEnabled': {value: true},
'fullscreen': {value: true},
'fullscreenElement': {value: document.fullscreenElement.wrappedJSObject}});
document.addEventListener(
window.addEventListener(
'fullscreenchange', evt => evt.stopImmediatePropagation(), true);
}, { capture: true, once: true });