57fbfbd606
When we open a background tab, it gets a hardcoded size (800x600 or so) because it doesn't get resized by the layout yet. By resizing it to the size it'll actually have later, we make sure scrolling to an anchor in an background tab works, and JS also gets the correct size for background tabs. Fixes #1190 Fixes #2495 See #1417
25 lines
728 B
HTML
25 lines
728 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>window sizes</title>
|
|
|
|
<script>
|
|
function updateText(elem) {
|
|
var size = window.innerWidth + "/" + window.innerHeight;
|
|
document.getElementById(elem).textContent = size;
|
|
console.log(elem + " window size: " + size);
|
|
}
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
updateText("hidden");
|
|
console.log("loaded");
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p>visible: <span id="visible">unknown</span></p>
|
|
<p>hidden: <span id="hidden">unknown</span></p>
|
|
</body>
|
|
</html>
|