Ensure content of NoScript prompts is always visible.

This commit is contained in:
hackademix 2020-09-12 18:55:23 +02:00
parent 7b3fc6c0b7
commit 8169a7f561
3 changed files with 20 additions and 8 deletions

View File

@ -63,8 +63,8 @@ var Prompts = (() => {
checks: [],
buttons: [_("Ok"), _("Cancel")],
multiple: "close", // or "queue", or "focus"
width: 400,
height: 300,
width: 500,
height: 400,
alwaysOnTop: true,
},
async prompt(features) {

View File

@ -6,6 +6,7 @@ body {
color: #222;
margin: 0px;
padding: 8px;
background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 41%,#9fd8ef 90%,#2ab0ed 100%) no-repeat;
}
#header {
@ -13,10 +14,9 @@ body {
margin: 0;
line-height: 24px;
color: #048;
position: relative;
font-size: 24px;
z-index: 500;
padding: 8px;
padding: 8px 8px 0 8px;
display: block;
background: url(/img/icon96.png) no-repeat top right;
height: 96px;
@ -25,23 +25,21 @@ body {
#title {
margin-right: 96px;
font-size: 24px;
position: absolute;
bottom: 0;
top: 0;
}
#main {
background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 41%,#9fd8ef 90%,#2ab0ed 100%) no-repeat;
display: flex;
flex-direction: column;
align-items: center;
padding: 120px 16px 16px 16px;
padding: 0 16px;
top: 0;
left: 0;
right:0;
bottom: 0;
position: fixed;
justify-content: center;
overflow: auto;
}
#message {
flex-grow: 1;

View File

@ -88,4 +88,18 @@
for (let b of document.querySelectorAll("#buttons button")) {
b.addEventListener("click", buttonClicked);
}
let resize = async () => {
let win = await browser.windows.getCurrent();
let delta = document.documentElement.offsetHeight - window.innerHeight;
await browser.windows.update(win.id, {
width: win.width, height: win.height + delta,
left: win.left, top: win.top - Math.round(delta / 2)
});
}
if (document.readyState === "complete") {
resize();
} else {
window.addEventListener("load", resize);
}
})();