This commit is contained in:
Yanzhen Yu
2021-12-26 20:46:17 +08:00
parent bdbd204103
commit 5a0a1353c5

View File

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