Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. Zekfad revised this gist Jun 12, 2021. 1 changed file with 32 additions and 32 deletions.
    64 changes: 32 additions & 32 deletions Admiral-AntiAdblock-Killer.user.js
    Original file line number Diff line number Diff line change
    @@ -1,45 +1,45 @@
    // ==UserScript==
    // @name Admiral AntiAdblock Killer
    // @version 0.2
    // @description
    // @author JeremyLee
    // @version 0.3
    // @description Admiral AntiAdblock Killer
    // @author Zekfad
    // @match https://*/*
    // @match http://*/*
    // @grant none
    // @updateURL https://gist.github.com/JeremyLee/2f7ffe2c7ef6576de36795dadaa2a535/raw/Admiral-AntiAdblock-Killer.user.js
    // @updateURL https://gist.github.com/Zekfad/ed4f846bd51c8aff41f2cdaad24b21dd/raw/Admiral-AntiAdblock-Killer.user.js
    // ==/UserScript==

    (function() {
    window.setInterval(function(){
    window.setInterval(() => {
    if(document.getRootNode().children[0].style.overflow === "hidden" && document.getElementsByTagName("body")[0].style.overflow === "hidden") {
    // Admiral Anti Adblock sets these properties when it activates.

    if(document.getRootNode().children[0].style.overflow === "hidden" && document.getElementsByTagName("body")[0].style.overflow === "hidden") {
    // Admiral Anti Adblock sets these properties when it activates.

    // Search for the keyword to make sure it's actually the admiral anti-adblock. We don't want to clear the above properties if it's part of the page design.
    var aTags = document.getElementsByTagName("H3");
    var searchText = "Uh Oh...Adblocker detected!";
    var found;
    // Search for the keyword to make sure it's actually the admiral anti-adblock. We don't want to clear the above properties if it's part of the page design.
    const aTags = document.getElementsByTagName("H3");
    const searchText = "It looks like you're using an adblocker";
    let found;

    for (var i = 0; i < aTags.length; i++) {
    if (aTags[i].textContent == searchText) {
    found = aTags[i];
    break;
    }
    }
    for (let i = 0; i < aTags.length; i++) {
    if (aTags[i].textContent == searchText) {
    found = aTags[i];
    break;
    }
    }

    if(found){
    // Loop until we've found the topmost element that's part of admiral.
    while(found.parentElement.nodeName.toLowerCase() !== "body") {
    found = found.parentElement;
    }

    // Remove that stupid element
    found.remove();
    console.info('Admiral AntiAdblock killed.');

    if(found){
    // Loop until we've found the topmost element that's part of admiral.
    while(found.parentElement.nodeName !== "BODY") {
    found = found.parentElement;
    // Enable the scrollbars again.
    document.getRootNode().children[0].style.overflow = null;
    document.getElementsByTagName("body")[0].style.overflow = null;
    }
    }

    // Remove that stupid element
    found.remove()

    // Enable the scrollbars again.
    document.getRootNode().children[0].style.overflow = null
    document.getElementsByTagName("body")[0].style.overflow = null
    }
    }
    }, 100);
    }, 100);
    })();
  2. @peruihkxt peruihkxt renamed this gist May 23, 2019. 1 changed file with 2 additions and 2 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    // ==UserScript==
    // @name Remove Admiral Anti-AdBlock
    // @name Admiral AntiAdblock Killer
    // @version 0.2
    // @description
    // @author JeremyLee
    // @match https://*/*
    // @match http://*/*
    // @grant none
    // @updateURL https://gist.github.com/JeremyLee/2f7ffe2c7ef6576de36795dadaa2a535/raw/Anti-AdmiralAAB.user.js
    // @updateURL https://gist.github.com/JeremyLee/2f7ffe2c7ef6576de36795dadaa2a535/raw/Admiral-AntiAdblock-Killer.user.js
    // ==/UserScript==

    (function() {
  3. @peruihkxt peruihkxt revised this gist May 23, 2019. No changes.
  4. @peruihkxt peruihkxt revised this gist May 23, 2019. No changes.
  5. @peruihkxt peruihkxt revised this gist May 23, 2019. No changes.
  6. @peruihkxt peruihkxt revised this gist May 23, 2019. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Anti-AdmiralAAB.user.js
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    // ==UserScript==
    // @name Remove Admiral Anti-AdBlock
    // @version 0.1
    // @version 0.2
    // @description
    // @author JeremyLee
    // @match https://*/*
    // @match http://*/*
    // @grant none
    // @updateURL https://gist.github.com/JeremyLee/2f7ffe2c7ef6576de36795dadaa2a535/raw/Anti-AdmiralAAB.user.js
    // ==/UserScript==

    (function() {
    @@ -41,4 +42,4 @@
    }
    }
    }, 100);
    })();
    })();
  7. @peruihkxt peruihkxt created this gist May 23, 2019.
    44 changes: 44 additions & 0 deletions Anti-AdmiralAAB.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    // ==UserScript==
    // @name Remove Admiral Anti-AdBlock
    // @version 0.1
    // @description
    // @author JeremyLee
    // @match https://*/*
    // @match http://*/*
    // @grant none
    // ==/UserScript==

    (function() {
    window.setInterval(function(){

    if(document.getRootNode().children[0].style.overflow === "hidden" && document.getElementsByTagName("body")[0].style.overflow === "hidden") {
    // Admiral Anti Adblock sets these properties when it activates.

    // Search for the keyword to make sure it's actually the admiral anti-adblock. We don't want to clear the above properties if it's part of the page design.
    var aTags = document.getElementsByTagName("H3");
    var searchText = "Uh Oh...Adblocker detected!";
    var found;

    for (var i = 0; i < aTags.length; i++) {
    if (aTags[i].textContent == searchText) {
    found = aTags[i];
    break;
    }
    }

    if(found){
    // Loop until we've found the topmost element that's part of admiral.
    while(found.parentElement.nodeName !== "BODY") {
    found = found.parentElement;
    }

    // Remove that stupid element
    found.remove()

    // Enable the scrollbars again.
    document.getRootNode().children[0].style.overflow = null
    document.getElementsByTagName("body")[0].style.overflow = null
    }
    }
    }, 100);
    })();