我试图通过删除只读 css 类来使视频网站的搜索栏可点击和可控,但我必须为每个视频手动删除它。有没有什么方法可以永久删除它或在每次页面刷新时自动删除它?
我尝试手动摆脱它,这有效,但相当乏味。
<div id="seek" data-tabindex="0" tabindex="0" class="progress-bar read-only" style="position: absolute; left: 0px; top: 0px; overflow: visible; transform-origin: center center; width: 169px; height: 30px; transform: translate(44px, 18px); display: block;">
<style>
#seek:before {
border: 1px solid rgba(0, 0, 0, 0);
background-image: initial;
background-repeat: no-repeat !important;
}
</style>
有很多可能的方法可以做到这一点,但其中一种方法是通过像这样的 JS。
const readOnlys = document.querySelectorAll('.read-only')
for (let i = 0; i < readOnlys.length; i++) {
readOnlys[i].classList.remove('read-only').
}
如果运行此代码,它会选择具有
read-only
类的所有元素,然后将其从这些元素中删除。