nodebb-plugin-ezoic-infinite 1.5.53 → 1.5.54

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 +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.5.53",
3
+ "version": "1.5.54",
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
@@ -386,10 +386,15 @@ function withInternalDomChange(fn) {
386
386
  try {
387
387
  const domId = `${PLACEHOLDER_PREFIX}${id}`;
388
388
  const ph = document.getElementById(domId);
389
- if (ph && ph.dataset) {
389
+
390
+ // If the element is already gone, do NOT call destroyPlaceholders (Ezoic will log "does not exist").
391
+ if (!ph || !ph.isConnected) return;
392
+
393
+ if (ph.dataset) {
390
394
  delete ph.dataset.ezDefined;
391
395
  delete ph.dataset.ezRequested;
392
396
  }
397
+
393
398
  const ez = window.ezstandalone;
394
399
  if (ez && typeof ez.destroyPlaceholders === 'function') {
395
400
  ez.destroyPlaceholders([domId]);