There's a specific script on a site I would like to disable without stopping the other scripts from working. I am using Firefox with Adblock Plus and Greasemonkey. I already googled extensively and tried different approaches but ultimately failed to succeed. Seems like I don't have enough understanding when it comes to setting up userscripts or defining adblock rules.

This is the script I need to block. It's an annoying popunder. The content gets blocked by Adblock but an unwanted empty window still opens everytime I click on the page.

under: true, 
newTab: false,
perpage: 5,
cookieExpires: 600,

Any help would be appreciated.

  • A link to the page would be helpful. Is it something like this ? (popunder opens when clicking on the page) – lemonsqueeze Oct 8 '16 at 5:40

Try uBlock Origin instead of AdBlockPlus maybe ?

It has specific code to block popups / popunders.

enter image description here

  • This doesn't address OP's question, which is how to disable a specific script. – TylerH Nov 18 '19 at 21:33

I'm really a beginner in understanding and debugging of HTML. And I was experiencing this problem to and I've tried several options but nothing worked. like a filter option in ABP that blocks the URL of the popup that was created by the script. (before i knew about where it specifically came from/was generated by)

So i went digging in the HTML source code and found exactly what you described. A java popunder script. and this piece of code was right above it:

<script type="application/ld+json">
  "@context": "http://schema.org",
  "@type": "WebSite",
  "url": "http://www.your-specific-website.com/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "http://www.popup-you-want-to-disable.com/search/?q={search_term_string}",
    "query-input": "required name=search_term_string"

<script src="http://www.your-specific-website.com/js/script.js"></script>
<script src="http://www.your-specific-website.com/js/license.4.js"></script>

this let me know that the pupunder was generated by a script what was located in *js/script.js (because of this line <script src="http://www.your-specific-website.com/js/script.js"></script>)

so i had to create a custom filter to prevent this script from being read.

so i added this custom ABP filter


and until now it seems to work exactly like i hoped (so it only blocks the annoying pupunder and not more than i want. cause there were other java applications or scripts running on the website)

I have tried to reproduce that the website does open the popop/popunder but it hasn't done yet. So until i do get it again, with the filter enabled, i consider this fix working.

Goodluck to you, and i hope this gets it fixed for you.

(Again, I'm only a hobbyist who likes to find out what causes the errors/unwanted actions i come across. So if someone with more knowledge about the html code or this specific problem reads this and thinks this is definitely not a solution for this problem, please say so, and, show me what i have to do for this problem to be solved.)


I think you can call BetterJsPop.reset(); using the console or bookmarklet ( bookmark where the URL is javascript:BetterJsPop.reset();void(0)) depending on the version of BetterJsPop.


Install uBlock Origin Add filter to filters list:


Replace webpage.com with page you want. Raplece ... with text witch script contains, it may be function name or part of text line in code. For ex. if script looks like this:

    function nuisanceCode() {

You should replace ... with nuisanceCode or blablabla

More: https://github.com/gorhill/uBlock/wiki/Inline-script-tag-filtering

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.