[英]How do I create a bookmarklet to hide a specific page element?
I'm a total noob with bookmarklets.我是一个小书签的菜鸟。 Can anyone help me with the code I need to put in my bookmark URL to hide this specific page element?任何人都可以帮助我使用我需要放入书签 URL 以隐藏此特定页面元素的代码吗?
<div id="snigel-cmp-framework" class="snigel-cmp-framework" style="height: 722px;">
It's for a website I access a lot with a super annoying/aggressive cookie policy.这是一个我经常使用超级烦人/激进的 cookie 政策访问的网站。 You have to click a million checkboxes to opt out, and your preferences are erased when you close your browser.您必须单击一百万个复选框才能选择退出,当您关闭浏览器时,您的偏好将被删除。
Thanks!谢谢!
It's a simple javascript, you just need to make it a one liner, and add javascript:
as href of the link you shall drag to your bookmark bar to become bookmarklet.这是一个简单的 javascript,您只需将其设为一个衬里,然后添加javascript:
作为链接的 href,您应将其拖动到书签栏以成为书签。 As for the code itself, it's pretty simple.至于代码本身,它非常简单。
<a href='javascript:var elem = document.querySelector("#snigel-cmp-framework"); elem && elem.remove()'>Drag me to bookmark bar</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.