post-pve-install mobile nag fix (#7567)

This commit is contained in:
dvino 2025-09-11 13:15:07 +02:00 committed by GitHub
parent d06ad37a22
commit 5385382a88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -530,14 +530,26 @@ if [ -f "$MOBILE_TPL" ] && ! grep -q "$MARKER" "$MOBILE_TPL"; then
printf "%s\n" \ printf "%s\n" \
"$MARKER" \ "$MARKER" \
"<script>" \ "<script>" \
" function watchAndRemoveDialog() {" \ " function removeSubscriptionElements() {" \
" const observer = new MutationObserver(() => {" \ " const dialogs = document.querySelectorAll('dialog.pwt-outer-dialog');" \
" const dialog = document.querySelector('dialog[aria-label=\"No valid subscription\"]');" \ " dialogs.forEach(dialog => {" \
" if (dialog) { dialog.remove(); console.log('Removed dialog: No valid subscription'); observer.disconnect(); }" \ " const closeButton = dialog.querySelector('.fa-close');" \
" const exclamationIcon = dialog.querySelector('.fa-exclamation-triangle');" \
" const continueButton = dialog.querySelector('button');" \
" if (closeButton && exclamationIcon && continueButton) { dialog.remove(); console.log('Removed subscription dialog'); }" \
" });" \
" const cards = document.querySelectorAll('.pwt-card.pwt-p-2.pwt-d-flex.pwt-interactive.pwt-justify-content-center');" \
" cards.forEach(card => {" \
" const hasInteractiveElements = card.querySelector('button, input, a');" \
" const hasComplexStructure = card.querySelector('.pwt-grid, .pwt-flex, .pwt-button');" \
" if (!hasInteractiveElements && !hasComplexStructure) { card.remove(); console.log('Removed subscription card'); }" \
" });" \ " });" \
" observer.observe(document.body, { childList: true, subtree: true });" \
" }" \ " }" \
" setTimeout(watchAndRemoveDialog, 100);" \ " const observer = new MutationObserver(removeSubscriptionElements);" \
" observer.observe(document.body, { childList: true, subtree: true });" \
" removeSubscriptionElements();" \
" setInterval(removeSubscriptionElements, 300);" \
" setTimeout(() => {observer.disconnect();}, 10000);" \
"</script>" \ "</script>" \
"" >> "$MOBILE_TPL" "" >> "$MOBILE_TPL"
fi fi