Ajustes visuais no comportamento da função de mostrar/ocultar a sidebar

This commit is contained in:
Paulo Porto
2026-05-27 11:08:37 -03:00
parent 29a461ea63
commit cbf9550f0b
4 changed files with 79 additions and 53 deletions

View File

@@ -57,6 +57,10 @@
function getAllowedTopMessageOrigin() {
const candidates = [];
if (window.top === window) {
return getSafeTargetOrigin();
}
try {
const referrerOrigin = document.referrer
? new URL(document.referrer).origin
@@ -76,10 +80,6 @@
// ancestorOrigins is browser-specific and may be unavailable.
}
if (window.top === window) {
candidates.push(getSafeTargetOrigin());
}
for (const origin of candidates) {
if (ALLOWED_TOP_MESSAGE_ORIGINS.has(origin)) {
return origin;