• Resolved pharmanext

    (@pharmanext)


    Hi,

    PageSpeed gives an issue with Avoid serving legacy JavaScript to modern browsers. Specifically with Array.prototype.includes and Number.isInteger.

    The issue is exactly related to Ad Inserter. I did an extensive investigation of the issue, which took a lot of time to localize.

    First, if I completely reset the Ad Inserter settings, the issue goes away.

    Second, the issue with Array.prototype.includes appears if I use the After HTML element, Before HTML element, or Inside HTML element insertion mode.

    Third, the issue with Number.isInteger appears if Tracking is enabled in Settings and then activated for a particular block with some content.

    Fourth, the following should be done for the final check. It is necessary to reset completely Ad Inserter settings and turn on two blocks, for example 1 and 2, in which to enter any plain text. In block 1 you need to specify the insertion mode After HTML element, for block 2 you need to enable Tracking.

    Please fix these issues so that PageSpeed can calm down.

    Thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Spacetime

    (@spacetime)

    Hello,

    thanks for this report.
    The current code includes some polyfills in order to support older browsers.
    This was added as may users reported issues with browsers they use.

    The plugin is in the process of rewriting client-side code to be library independent (no jQuery, prure Javascripot) and to have an option to choose between inline and external code.

    Once this proces is finished the messages will no longer appear.
    Anyway, support for legacy browsers does not present any issue, except those messages.

    Plugin Author Spacetime

    (@spacetime)

    The latest development version supports option to load JavaScript code from a file – this code has no polyfills:
    https://downloads.wp.xz.cn/plugin/ad-inserter.zip

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Avoid serving legacy JavaScript to modern browsers’ is closed to new replies.