Printed fromChabad.gr
ב"ה

Community & Family

Insights and inspiration for the routines and struggles of daily life: commentary on current events and contemporary issues, articles on parenting and relationships, and more.

// ==UserScript== // @name Chabad.gr Mobile Fix // @namespace http://tampermonkey.net/ // @version 1.0 // @match https://www.chabad.gr/* // @grant none // ==/UserScript== (function () { // 1. תיקון viewport אם חסר או שגוי let viewport = document.querySelector('meta[name="viewport"]'); if (!viewport) { viewport = document.createElement('meta'); viewport.name = 'viewport'; document.head.appendChild(viewport); } viewport.content = 'width=device-width, initial-scale=1.0, maximum-scale=5.0'; // 2. CSS גלובלי לתיקון overflow ו-fixed widths const style = document.createElement('style'); style.textContent = ` /* מנע חיתוך אופקי */ html, body { max-width: 100vw !important; overflow-x: hidden !important; width: 100% !important; } /* תיקון טבלאות שמוגדרות ברוחב קבוע */ table { max-width: 100% !important; width: 100% !important; table-layout: auto !important; } /* תיקון תמונות שגולשות */ img { max-width: 100% !important; height: auto !important; } /* תיקון div/span עם רוחב קבוע */ div, span, section, article, aside, main { max-width: 100% !important; box-sizing: border-box !important; } /* תיקון wrappers עם רוחב קבוע נפוץ */ .container, .wrapper, .inner, .content, #container, #wrapper, #inner, #content, [class*="container"], [class*="wrapper"] { width: 100% !important; max-width: 100vw !important; min-width: unset !important; padding-left: 8px !important; padding-right: 8px !important; } /* תיקון עמודות צדדיות */ .col, .column, [class*="col-"] { float: none !important; width: 100% !important; display: block !important; } /* תיקון iframe */ iframe { max-width: 100% !important; } `; document.head.appendChild(style); // 3. תיקון דינמי של אלמנטים עם style inline שמכריחים רוחב function fixInlineWidths() { const allElements = document.querySelectorAll('[style]'); allElements.forEach(el => { const style = el.getAttribute('style'); if (style && style.match(/width\s*:\s*\d{3,4}px/)) { el.style.width = '100%'; el.style.maxWidth = '100%'; el.style.minWidth = 'unset'; } }); } // הפעל מיד ואחרי שה-DOM נטען לחלוטין fixInlineWidths(); window.addEventListener('load', fixInlineWidths); // 4. תיקון אם יש MutationObserver (לתוכן שנטען דינמית) const observer = new MutationObserver(() => fixInlineWidths()); observer.observe(document.body, { childList: true, subtree: true }); })();