fix obs popup issues
This commit is contained in:
12
src/app.js
12
src/app.js
@@ -4888,7 +4888,11 @@ function clearGeneratedFinals(eventId) {
|
||||
}
|
||||
|
||||
function openPrintWindow(title, bodyHtml) {
|
||||
const printWindow = window.open("", "_blank", "noopener,noreferrer,width=1200,height=900");
|
||||
// noopener/noreferrer force window.open() to return null even when the window opens
|
||||
// successfully (WHATWG spec, all modern browsers), which made the blocked-popup check
|
||||
// below always fire and this always exit before writing any content. The opened window
|
||||
// only ever holds first-party generated HTML, so dropping both flags is safe here.
|
||||
const printWindow = window.open("", "_blank", "width=1200,height=900");
|
||||
if (!printWindow) {
|
||||
alert(t("error.print_blocked"));
|
||||
return;
|
||||
@@ -5309,10 +5313,14 @@ function buildOverlayUrl(mode = "leaderboard", options = {}) {
|
||||
function openOverlayWindow(mode = "leaderboard", options = {}) {
|
||||
const width = Math.max(1280, window.screen?.availWidth || 1600);
|
||||
const height = Math.max(720, window.screen?.availHeight || 900);
|
||||
// noopener/noreferrer force window.open() to return null even when the window opens
|
||||
// successfully (WHATWG spec, all modern browsers), which made the blocked-popup check
|
||||
// below always fire and overlayWindow.focus() below unreachable. The overlay URL is
|
||||
// always same-origin (see buildOverlayUrl), so dropping both flags is safe here.
|
||||
const overlayWindow = window.open(
|
||||
buildOverlayUrl(mode, options),
|
||||
"_blank",
|
||||
`noopener,noreferrer,popup=yes,left=0,top=0,width=${width},height=${height}`
|
||||
`popup=yes,left=0,top=0,width=${width},height=${height}`
|
||||
);
|
||||
if (!overlayWindow) {
|
||||
alert(t("error.print_blocked"));
|
||||
|
||||
Reference in New Issue
Block a user