diff --git a/core/client.js b/core/client.js index e587124d..8fef6c73 100644 --- a/core/client.js +++ b/core/client.js @@ -644,7 +644,8 @@ function api_localStorageGet(key) { } function api_requestPermission(permission, id) { - let permissions = document.getElementById('permissions'); + let outer = document.createElement('div'); + outer.classList.add('permissions'); let container = document.createElement('div'); container.classList.add('permissions_contents'); @@ -688,17 +689,14 @@ function api_requestPermission(permission, id) { button.innerText = option.text; button.onclick = function() { resolve(option.grant[check.checked ? 1 : 0]); - while (permissions.firstChild) { - permissions.removeChild(permissions.firstChild); - } - permissions.style.visibility = 'hidden'; + document.body.removeChild(outer); } div.appendChild(button); } container.appendChild(div); + outer.appendChild(container); - permissions.appendChild(container); - permissions.style.visibility = 'visible'; + document.body.appendChild(outer); }); } diff --git a/core/style.css b/core/style.css index a7598f6f..23099de9 100644 --- a/core/style.css +++ b/core/style.css @@ -230,8 +230,7 @@ kbd { white-space: nowrap; } -#permissions { - visibility: hidden; +.permissions { position: absolute; display: block; top: 0;