-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.js
29 lines (26 loc) · 933 Bytes
/
sync.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
if (!isSecureContext) {
location.protocol = 'http:';
}
(async() => {
window.addEventListener('load', () => {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
});
if (window.matchMedia('(display-mode: standalone)').matches) {
document.querySelector('#BOWinstallApp').hidden = true;
document.querySelector('#BOWprotocol').hidden = false;
}else{
document.querySelector('#BOWinstallApp').hidden = false;
}
const search = decodeURIComponent(location.search);
if (search.includes('bow')) {
document.querySelector('#BOWframe').hidden = false;
} else if (search.includes('ott')) {
document.querySelector('#OTTframe').hidden = false;
}
document.querySelector('#BOWregProto').addEventListener('click', () => {
navigator.registerProtocolHandler('fdp', 'api/fdp/%s');
navigator.registerProtocolHandler('otsl', 'api/otsl/%s');
});
})();