Skip to content

Commit 8169a7f

Browse files
committed
Ensure content of NoScript prompts is always visible.
1 parent 7b3fc6c commit 8169a7f

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/ui/Prompts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ var Prompts = (() => {
6363
checks: [],
6464
buttons: [_("Ok"), _("Cancel")],
6565
multiple: "close", // or "queue", or "focus"
66-
width: 400,
67-
height: 300,
66+
width: 500,
67+
height: 400,
6868
alwaysOnTop: true,
6969
},
7070
async prompt(features) {

src/ui/prompt.css

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ body {
66
color: #222;
77
margin: 0px;
88
padding: 8px;
9+
background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 41%,#9fd8ef 90%,#2ab0ed 100%) no-repeat;
910
}
1011

1112
#header {
1213
text-align: left;
1314
margin: 0;
1415
line-height: 24px;
1516
color: #048;
16-
position: relative;
1717
font-size: 24px;
1818
z-index: 500;
19-
padding: 8px;
19+
padding: 8px 8px 0 8px;
2020
display: block;
2121
background: url(/img/icon96.png) no-repeat top right;
2222
height: 96px;
@@ -25,23 +25,21 @@ body {
2525
#title {
2626
margin-right: 96px;
2727
font-size: 24px;
28-
position: absolute;
2928
bottom: 0;
3029
top: 0;
3130
}
3231

3332
#main {
34-
background: linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 41%,#9fd8ef 90%,#2ab0ed 100%) no-repeat;
3533
display: flex;
3634
flex-direction: column;
3735
align-items: center;
38-
padding: 120px 16px 16px 16px;
36+
padding: 0 16px;
3937
top: 0;
4038
left: 0;
4139
right:0;
4240
bottom: 0;
43-
position: fixed;
4441
justify-content: center;
42+
overflow: auto;
4543
}
4644
#message {
4745
flex-grow: 1;

src/ui/prompt.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,18 @@
8888
for (let b of document.querySelectorAll("#buttons button")) {
8989
b.addEventListener("click", buttonClicked);
9090
}
91+
92+
let resize = async () => {
93+
let win = await browser.windows.getCurrent();
94+
let delta = document.documentElement.offsetHeight - window.innerHeight;
95+
await browser.windows.update(win.id, {
96+
width: win.width, height: win.height + delta,
97+
left: win.left, top: win.top - Math.round(delta / 2)
98+
});
99+
}
100+
if (document.readyState === "complete") {
101+
resize();
102+
} else {
103+
window.addEventListener("load", resize);
104+
}
91105
})();

0 commit comments

Comments
 (0)