diff --git a/Introduction-to-basic-filtering-syntax.md b/Introduction-to-basic-filtering-syntax.md index dab6998..a5b8a71 100644 --- a/Introduction-to-basic-filtering-syntax.md +++ b/Introduction-to-basic-filtering-syntax.md @@ -24,7 +24,7 @@ Selecting by attribute: To learn more, see the [documentation](https://github.com/uBlockOrigin/uBlock-issues/wiki/Static-filter-syntax#static-extended-filtering) -## Investigating anti-adblock scripts +## Investigating anti-blocker scripts The following steps require that you use your browser's developer tools, including the debugger. If you aren't familiar with these, you should refer to the documentation provided by your browser: @@ -38,20 +38,20 @@ It also requires that you have familiarity with HTML and CSS as well as some Jav Steps: -1. Inspect the anti-adblock element. Note the element's ID, class(es), and other attribute(s) (e.g. `hidden`), text inside the element, etc. +1. Inspect the anti-blocker element. Note the element's ID, class(es), and other attribute(s) (e.g. `hidden`), text inside the element, etc. -2. Using your browser dev tools, add a breakpoint for `DOMContentLoaded` (under `DOM Mutation`) and reload the page. Usually this will pause the debugger before the anti-adblock popup is displayed. If it doesn't, you can try using the `Script First Statement` (under `Script`) breakpoint (but you may then need to repeatedly click the unpause button to skip the extension scripts before you get to the site's scripts). +2. Using your browser dev tools, add a breakpoint for `DOMContentLoaded` (under `DOM Mutation`) and reload the page. Usually this will pause the debugger before the anti-blocker popup is displayed. If it doesn't, you can try using the `Script First Statement` (under `Script`) breakpoint (but you may then need to repeatedly click the unpause button to skip the extension scripts before you get to the site's scripts). 3. After the debugger is paused, remove the breakpoint. **Important**: DO NOT unpause the debugger, as this will cause the site's detection script to run. 3. Select the Inspector (Firefox) / Elements (Chrome) tab and search for the element using the information you noted in Step 1. > The search bar isn't visible in chrome by default, to get it to show, press `Ctrl+F`. -4. If it's hidden with CSS (e.g. `display: none;`), set a breakpoint for `attribute modification` from the context menu. This will pause the debugger when the element is shown, since the script will change the attributes (e.g. `class`) to unhide the element on detection. If the anti-adblock element does not exist at all, look for the parent element of that element add a breakpoint for `subtree modification` to the parent element (if that doesn't exist, look for the parent element of that parent element, and so on). This will pause when the element is inserted into the web page. +4. If it's hidden with CSS (e.g. `display: none;`), set a breakpoint for `attribute modification` from the context menu. This will pause the debugger when the element is shown, since the script will change the attributes (e.g. `class`) to unhide the element on detection. If the anti-blocker element does not exist at all, look for the parent element of that element add a breakpoint for `subtree modification` to the parent element (if that doesn't exist, look for the parent element of that parent element, and so on). This will pause when the element is inserted into the web page. 5. Now, you can freely unpause the debugger. -6. As soon as the site detects uBO and shows the anti-adblock popup, it will pause the detection code in the debugger. +6. As soon as the site detects uBO and shows the anti-blocker popup, it will pause the detection code in the debugger. 7. Sometimes, the site uses libraries like jQuery, and the debugger may pause into such libraries instead of the main script. You have to use the debugger's `Call stack` section to traverse back to the main script (tip: if there's an "Expand rows" button, click on it to reveal more scripts in the call stack).