Greasemonkey 脚本可以覆盖 AdBlock 过滤器吗?
我有一个 Greasemonkey 脚本,它试图访问一个 HTML 元素Adblock 正在停用。 是否可以使用 Greasemonkey 脚本创建一个解决方法来防止与 Adblock 插件发生冲突?
我对任何想法持开放态度,但是更改脚本以避免 Adblock 元素目前并不是解决方案。
其他信息
我试图“启用”的 addblock 元素是来自 google 搜索结果的 Table 元素。
<table id="mbEnd" width="30%" style="margin-bottom: 1em;">
隐藏元素的 Adblock 过滤器是:
google.com,google.com.au,google.co.uk,google.ca,google.se#table(id=mbEnd)(width=30%)
更新: 有些人建议我简单地禁用我正在处理的页面的 adblock 过滤器。 我也认为这不是解决方案,因为任何使用我的脚本的人都必须执行相同的操作,而且我不能指望我的所有用户都手动修改他们的 Adblock 设置。
I have a Greasemonkey script that is trying to access an HTML element that Adblock is disabling. Is it possible to create a workaround with the Greasemonkey script to prevent conflicts with the Adblock plugin?
I'm open to any ideas, however changing the script to avoid the Adblock element is not a solution at this time.
Additional Info
The addblock element I am trying to "enable" is a Table element from a google search result.
<table id="mbEnd" width="30%" style="margin-bottom: 1em;">
The Adblock filter hiding the element is:
google.com,google.com.au,google.co.uk,google.ca,google.se#table(id=mbEnd)(width=30%)
Update: Some are suggesting that I simply disable the adblock filter for the page I am working on. I also consider this a non-solution, since anyone using my script would have to perform the same action, and I can not expect all my users to manually modify their Adblock settings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以禁用特定页面或域的广告拦截。 只需单击该符号旁边的箭头,它就会为您提供更多禁用广告拦截的选项。
无法使 Greasemonkey 脚本自动覆盖 Adblock,因为 Adblock 在加载任何 Greasemonkey 脚本之前会影响页面。
You can disable adblock for specific pages or domains. Just click the arrow next to the symbol and it'll give you more options for disabling adblock.
There is no way to make a Greasemonkey script automatically override Adblock, as Adblock affects the page before any Greasemonkey scripts are loaded.
您想要访问什么类型的元素? 大多数页面元素应该仍然可用,只是带有“display:none;”。
我在 Greasemonkey 脚本中使用 jQuery,在使用 ABP 禁用图像后,它能够从图像中获取替代文本。
如果您提供一些更具体的信息,我也许能够提供更具体的解决方案。
访问被阻止的 iframe 可能更困难,但也是可行的。 同样,更多细节将帮助我回答。
What type of elements are you trying to access? Most of the page elements should still be available, just with 'display: none;'.
I use jQuery in my Greasemonkey scripts and it is able to get the alt text from an image after I have disabled it with ABP.
If you provide some more specific information I may be able to provide a more specific solution.
Accessing iframes that are blocked may be harder but doable. Again, more specifics will help me answer.