This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 2981181ffd
commit 44eab895e4

View File

@@ -10,10 +10,8 @@ import {
MaskTextFn,
MaskInputFn,
KeepIframeSrcFn,
documentNode,
} from './types';
import { isElement, isShadowRoot, maskInputValue } from './utils';
import { values } from 'puppeteer/DeviceDescriptors';
let _id = 1;
const tagNameRegex = new RegExp('[^a-z0-9-_:]');
@@ -55,7 +53,9 @@ function getCssRuleString(rule: CSSRule): string {
if (isCSSImportRule(rule)) {
try {
cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;
} catch {}
} catch {
// ignore
}
}
return cssStringified;
}
@@ -136,8 +136,8 @@ function getAbsoluteSrcsetString(doc: Document, attributeValue: string) {
let pos = 0;
function collectCharacters(regEx: RegExp) {
var chars,
match = regEx.exec(attributeValue.substring(pos));
let chars: string;
let match = regEx.exec(attributeValue.substring(pos));
if (match) {
chars = match[0];
pos += chars.length;