Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
fix(tk:ext): use HTMLSize utils to calculate valid html size before s…
Browse files Browse the repository at this point in the history
…ending
  • Loading branch information
ascariandrea committed Oct 5, 2022
1 parent b0a0d05 commit fef5689
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions platforms/tktrex/extension/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import {
} from '@shared/extension/app';
import log from '@shared/extension/logger';
import UserSettings from '@shared/extension/models/UserSettings';
import { sizeCheck } from '@shared/providers/dataDonation.provider';
import { HTMLSize } from '@shared/extension/utils/HTMLSize.utils';
import _ from 'lodash';
import tkHub from '../handlers/hub';
import { INTERCEPTED_ITEM_CLASS } from '../interceptor/constants';

export const appLog = log.extend('app');
const searchSize = HTMLSize();

export let feedId = refreshUUID(0);
export let feedCounter = 0;
Expand Down Expand Up @@ -205,7 +206,7 @@ const handleSearch = _.debounce((element: Node): void => {
const contentHTML = contentNode ? contentNode.innerHTML : null;
if (!contentNode || !contentHTML) return;

const hasNewElements = sizeCheck(contentNode.innerHTML);
const hasNewElements = searchSize.check(contentNode.innerHTML);
if (!hasNewElements) return;

tkHub.dispatch({
Expand Down

0 comments on commit fef5689

Please sign in to comment.