nodebb-plugin-ezoic-infinite 1.5.88 → 1.5.89

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/client.js +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.5.88",
3
+ "version": "1.5.89",
4
4
  "description": "Production-ready Ezoic infinite ads integration for NodeBB 4.x",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -1,7 +1,14 @@
1
1
  (function () {
2
2
  'use strict';
3
3
 
4
- var EZOIC_SAFE_MODE = true;
4
+ function purgeEzoicWrapsInContainer(containerEl) {
5
+ try {
6
+ if (!containerEl || !containerEl.querySelectorAll) return;
7
+ containerEl.querySelectorAll('.nodebb-ezoic-wrap').forEach(function (n) {
8
+ try { n.remove(); } catch (e) {}
9
+ });
10
+ } catch (e) {}
11
+ }
5
12
 
6
13
 
7
14
  // Track scroll direction to avoid aggressive recycling when the user scrolls upward.
@@ -707,7 +714,6 @@ function globalGapFixInit() {
707
714
  }
708
715
 
709
716
  function pruneOrphanWraps(kindClass, items) {
710
- // V4.1 safe mode: no DOM removals here to avoid breaking infinite-scroll internals.
711
717
  return;
712
718
  }
713
719
 
@@ -952,6 +958,9 @@ function buildOrdinalMap(items) {
952
958
  }
953
959
 
954
960
  function injectBetween(kindClass, items, interval, showFirst, allIds, cursorKey) {
961
+ // V5: local stateless mode (container only)
962
+ purgeEzoicWrapsInContainer(containerEl);
963
+
955
964
  if (!items.length) return 0;
956
965
 
957
966
  const { map: ordinalMap, max: maxOrdinal } = buildOrdinalMap(items);