You can use :contains
selector to find scripts which contain keyword 'zopim'
in text and then count found script elements:(您可以使用:contains
选择器来查找文本中包含关键字'zopim'
脚本,然后计算找到的脚本元素:)
const scriptsWithKeywordCount = $('script:contains("zopim")').length;
if (scriptsWithKeywordCount > 0) {
// webpage contains keyword in javascript code
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…