Skip to content

Commit ee0469d

Browse files
Remove blank page collection cache (#2033)
* Remove blank page collection cache * Lint fix (why lol?)
1 parent d926037 commit ee0469d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

injected/src/features/page-context.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export default class PageContext extends ContentFeature {
381381

382382
startObserving() {
383383
this.log.info('Starting observing', this.mutationObserver, this.#cachedContent);
384-
if (this.mutationObserver && this.#cachedContent && !this.isObserving) {
384+
if (this.mutationObserver && this.#cachedContent && !this.isObserving && document.body) {
385385
this.isObserving = true;
386386
this.mutationObserver.observe(document.body, {
387387
childList: true,
@@ -445,7 +445,9 @@ export default class PageContext extends ContentFeature {
445445
}
446446

447447
// Cache the result - setter handles timestamp and observer
448-
this.cachedContent = content;
448+
if (content.content.length > 0) {
449+
this.cachedContent = content;
450+
}
449451
return content;
450452
}
451453

0 commit comments

Comments
 (0)