ultimate-jekyll-manager 0.0.255 → 0.0.257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,12 @@ export default function (Manager, options) {
11
11
  // Get auth policy
12
12
  const config = webManager.config.auth.config;
13
13
  const policy = config.policy;
14
+
15
+ // Skip auth module entirely if policy is disabled (e.g., vert iframes)
16
+ if (policy === 'disabled') {
17
+ return;
18
+ }
19
+
14
20
  const authenticated = config.redirects.authenticated;
15
21
  const unauthenticated = config.redirects.unauthenticated;
16
22
 
@@ -11,15 +11,24 @@ const searchParams = new URLSearchParams(window.location.search);
11
11
  const qsDebug = searchParams.get('debug') === 'true';
12
12
  const qsLoud = searchParams.get('loud') === 'true';
13
13
 
14
- // Protect height-constrained ancestors from AdSense's height: auto !important override.
15
- // Walks up from the ad's script element and observes any ancestor with a fixed-height class.
14
+ // AdSense aggressively overrides styles with height: auto !important on ancestor elements.
15
+ // This protects height-constrained ancestors and the vert-unit itself from being tampered with.
16
16
  const HEIGHT_CLASSES = ['vh-100', 'h-100', 'min-vh-100'];
17
- const protectAncestorHeights = ($el) => {
17
+ const protectFromAdSenseOverrides = ($el, $vertUnit, resolvedSize) => {
18
+ // Protect the vert-unit's max-height constraint
19
+ if (resolvedSize) {
20
+ new MutationObserver(() => {
21
+ if ($vertUnit.style.getPropertyValue('max-height') !== resolvedSize) {
22
+ $vertUnit.style.setProperty('max-height', resolvedSize, 'important');
23
+ }
24
+ }).observe($vertUnit, { attributes: true, attributeFilter: ['style'] });
25
+ }
26
+
27
+ // Protect height-constrained ancestors
18
28
  let $current = $el?.parentElement;
19
29
  while ($current && $current !== document.body) {
20
30
  if (HEIGHT_CLASSES.some((cls) => $current.classList.contains(cls))) {
21
31
  const $protected = $current;
22
- console.log('[Vert] Protecting ancestor height:', $protected.className);
23
32
  new MutationObserver(() => {
24
33
  if ($protected.style.height) {
25
34
  $protected.style.removeProperty('height');
@@ -242,9 +251,6 @@ const resolveSize = (value) => {
242
251
 
243
252
  // Function to create and insert the ad unit
244
253
  const createAdUnit = (config, $currentScript) => {
245
- // Protect height-constrained ancestors before ads modify them
246
- protectAncestorHeights($currentScript);
247
-
248
254
  // Create ad unit elements
249
255
  const $vertUnit = document.createElement('vert-unit');
250
256
 
@@ -253,12 +259,17 @@ const createAdUnit = (config, $currentScript) => {
253
259
  $vertUnit.setAttribute('data-wm-bind', '@hide auth.account.subscription.product.id !== basic');
254
260
 
255
261
  // Apply size constraint if specified
262
+ let resolvedSize = '';
256
263
  if (config.size) {
264
+ resolvedSize = resolveSize(config.size);
257
265
  $vertUnit.setAttribute('data-vert-size', config.size);
258
- $vertUnit.style.maxHeight = resolveSize(config.size);
259
- $vertUnit.style.overflow = 'hidden';
266
+ $vertUnit.style.setProperty('max-height', resolvedSize, 'important');
267
+ $vertUnit.style.setProperty('overflow', 'hidden');
260
268
  }
261
269
 
270
+ // Protect vert-unit and height-constrained ancestors from AdSense style overrides
271
+ protectFromAdSenseOverrides($currentScript, $vertUnit, resolvedSize);
272
+
262
273
  // Create the ins element for AdSense
263
274
  const $ins = document.createElement('ins');
264
275
  $ins.className = 'adsbygoogle';
@@ -118,7 +118,7 @@
118
118
  Remove with {% uj_icon "crown", "fa-sm text-success" %} <span class="text-success">Premium</span>
119
119
  </a>
120
120
  <!-- Sidebar Ad -->
121
- {% include /modules/adunits/adsense.html type="in-article" vert-size="rectangle" %}
121
+ {% include /modules/adunits/adsense.html type="in-article" vert-size="380" %}
122
122
  {% endif %}
123
123
  </div>
124
124
  {% endif %}
@@ -237,7 +237,7 @@
237
237
  Remove with {% uj_icon "crown", "fa-sm text-success" %} <span class="text-success">Premium</span>
238
238
  </a>
239
239
  <!-- Mobile Sidebar Ad -->
240
- {% include /modules/adunits/adsense.html type="in-article" vert-size="rectangle" %}
240
+ {% include /modules/adunits/adsense.html type="in-article" vert-size="380" %}
241
241
  {% endif %}
242
242
  </div>
243
243
  {% endif %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-jekyll-manager",
3
- "version": "0.0.255",
3
+ "version": "0.0.257",
4
4
  "description": "Ultimate Jekyll dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {