[英]remove all aria-hidden=“true” from source code
I'm trying to remove all the aria-hidden="true" from my html using tampermonkey 我正在尝试使用tampermonkey从我的html中删除所有aria-hidden =“ true”
I've tried to make them visible using this code 我试图使用此代码使它们可见
var HiddenElements = document.evaluate("//[@aria-hidden='true']",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = HiddenElements.snapshotLength - 1; i >= 0; i--) {
var elmHidden = HiddenElements.snapshotItem(i);
elmHidden.style.outline = 'rgb(255, 0, 78) dashed 3px';
elmHidden.ariahidden = 'false';
}
Is there any way to make this work ? 有什么办法可以使这项工作吗? and how to debug the results while testing?
以及如何在测试时调试结果?
Regards! 问候!
Here is an example of how it can be done: 这是一个如何完成的示例:
document.querySelectorAll('[aria-hidden="true"]').forEach(item => {
item.style.outline = 'rgb(255, 0, 78) dashed 3px';
item.setAttribute('aria-hidden', 'false');
// or remove it
item.removeAttribute('aria-hidden');
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.