• Resolved andreumomi

    (@andreumomi)


    Hi I’m having issues trying to block the following javascript code for Adsterra ads (I tried adding the code with and without the <script></script> tags):

    
    <script>document.write(atob("PHNjcmlwdCB0eXBlPSd0ZXh0L2phdmFzY3JpcHQnIHNyYz0nLy9vdmVybG9hZG1hdHVyZXNwYW5uZXIuY29tLzE3L2JjLzZjLzE3YmM2YzFjMjkyOWM3ZDYxZjAzMmVkNTI1MjcyNWExLmpzJz48L3NjcmlwdD4="));</script>

    The error states document.write can be a form of eval

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter andreumomi

    (@andreumomi)

    PS: When I add the script without the script tags, if I accept cookies the page remains blank (its not a caching issue as I tried loading from other devices, clearing browser data and incognito modes)

    • This reply was modified 10 months, 2 weeks ago by andreumomi.
    Plugin Contributor jarnovos

    (@jarnovos)

    Hi @andreumomi,

    That’s because this script uses document.write, and if that’s invoked after the initial page parsing is done, it clears the entire document (hence the blank page).

    If you’re allowed to modify their script, you could instead create a new script element and set it’s src attribute to the URL as extracted from the base64 encoded string.

    Here’s my example, which should work when added to the Script Center. But please note that this is merely an example of how you could do it, as I don’t know the specifics regarding Adsterra and whether you’re allowed to make such modifications.

    adsterra-example-modification.js

    Kind regards, Jarno

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Script blocker not working’ is closed to new replies.