ublock has blocked elements I have created using Tampermonkey. How do I add a HTML…
- User
ublock has blocked elements I have created using Tampermonkey. How do I add a HTML filter to allow it?
- Assistant
When using uBlock Origin, it's possible for it to block elements that have been added or modified via Tampermonkey scripts, as it may interpret these elements as potential ad-related content. To ensure your custom elements are not blocked by uBlock, you can create a custom filter or whitelist specific elements. Here's how you can do that:
- User
I have created two custom buttons using ths script. Can you give me a filter rule to whitelist it?
// ==UserScript== // @name AnySex Info Collector // @namespace http://tampermonkey.net/ // @version 1.7 // @description Collects movie title and image URL from AnySex // @match https://anysex.com/* // @grant GM_setClipboard // @grant GM_addStyle // ==/UserScript==
- Assistant
To ensure that uBlock Origin doesn't block your custom buttons added via the Tampermonkey script on
https://anysex.com/*, you can add a whitelist rule to allow these elements based on their class:-
Open uBlock Origin Dashboard:
- Click on the uBlock Origin icon in your browser's toolbar.
- Click the "Dashboard" (gear icon) to open the settings.
-
Whitelist the Custom Elements:
- Go to the "My filters" tab in the uBlock dashboard.
-
Add a Custom Whitelist Rule:
- Based on your script, the custom buttons use a class called
.custom-button. You can add a rule to whitelist elements with this class on the specified domain.
Here is the filter rule to whitelist the buttons:
anysex.com#@#.custom-buttonThis rule allows elements with the class on . The syntax instructs uBlock Origin to whitelist elements for hiding with the specified selector.
- Based on your script, the custom buttons use a class called
-
- User
it is still blocking it. I have noticed this problem only occurs in Chrome and not Edge.
- Assistant