• The latest version of the AMP plugin will serve module scripts to supporting browsers.

    The Module scripts will be served to modern browsers and nomodule scripts will be served to old browsers.

    Breeze plugin’s minification and deferring functonalitiues are stripping out the type="module" and nomodule attribute from a script which is required, and replacing them with application/javascript

    I will recommend adding a check for the AMP version of the page and skipping the minification feature

    
    // The Page is AMP so don't minifiy stuff.
    if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
        return false;
    }
    
Viewing 9 replies - 1 through 9 (of 9 total)
  • For reference, AMP serves module/nomodule scripts now like this:

    <script src="https://cdn.ampproject.org/v0/amp-analytics-0.1.mjs" async="" custom-element="amp-analytics" type="module" crossorigin="anonymous"></script>
    <script async nomodule src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js" crossorigin="anonymous" custom-element="amp-analytics"></script>

    Note the presence of type="module" and nomodule on these two scripts.

    Plugin Author adeelkhan

    (@adeelkhan)

    could you please confirm that is there any error shown in the console network tab?

    Thread Starter Milind More

    (@milindmore22)

    Hello @adeelkhan

    There is no error on the console network tab, I have set up a demo site

    The Breeze Plugins stripping script attributes creates an invalid AMP page.
    You can test AMP validation using AMP Validator

    ref: AMP support topic

    Workaround: https://github.com/milindmore22/amp-breeze-compat

    Hey @adeelkhan I am having this same issue with different plugins. It appears the latest update for me is stipping out query string for plugin JS files. It is affecting the functionality of reCaptcha for my sites using different methods. Recaptcha through Contact Forms 7 (CF7) and Forminator Pro is being broke in the latest update since Recaptcha relies on the query strings. The only resolution is to completely disable the Breeze plugin. Turning off cache settings was not enough, only turning off the plugin completely got it working again.

    Plugin Author adeelkhan

    (@adeelkhan)

    @aedelgod
    could you please remove the tags in “Dealy JS inline script”?I think there is a conflict of tags used in your activated theme/plugin which may conflict at application.
    Also, let me know if you face further issues.

    Plugin Author adeelkhan

    (@adeelkhan)

    @milindmore22

    There is an option “Exclude JS” under the Advanced Options tab.
    Use this option to exclude JS files from Minification and Grouping. you may enter the URLs of JS files on each line.
    by using the option you can exclude the script URL which validates from AMP.

    Thread Starter Milind More

    (@milindmore22)

    Hello @adeelkhan

    Thanks for the suggestions,

    I was wondering if we can include AMP support within the Breeze Cache plugin. making it fully AMP compatible and we will be happy to list it on our AMP Ecosystem Page.

    We will be happy to contribute on Breeze Cache plugin.

    Plugin Author adeelkhan

    (@adeelkhan)

    we have included the task in our development list. we will release it in our upcoming releases.

    Thread Starter Milind More

    (@milindmore22)

    Thank you @adeelkhan looking forward to it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘It strips off script attributes’ is closed to new replies.