Compare commits
2 Commits
6b30769d96
...
d048360c11
Author | SHA1 | Date | |
---|---|---|---|
d048360c11 | |||
be49a31e54 |
@ -1,5 +1,5 @@
|
||||
[tool.bumpversion]
|
||||
current_version = "1.3.28"
|
||||
current_version = "1.3.29"
|
||||
commit = true
|
||||
tag = true
|
||||
tag_name = "{new_version}"
|
||||
|
@ -35,6 +35,11 @@
|
||||
<a class="nav-link" href="/urls">URLs</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<button id="enable-notifications" class="btn btn-outline-light">Enable Notifications</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@ -55,13 +60,19 @@
|
||||
{% block scripts %}{% endblock %}
|
||||
<script>
|
||||
if ('serviceWorker' in navigator && 'PushManager' in window) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('{{ url_for("static", filename="service-worker.js") }}').then(function(registration) {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
askPermission(registration);
|
||||
}, function(err) {
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
let swRegistration = null;
|
||||
navigator.serviceWorker.register('{{ url_for("static", filename="service-worker.js") }}').then(function(registration) {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
swRegistration = registration;
|
||||
}, function(err) {
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
|
||||
const enableNotificationsButton = document.getElementById('enable-notifications');
|
||||
enableNotificationsButton.addEventListener('click', function() {
|
||||
if (swRegistration) {
|
||||
askPermission(swRegistration);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user