• Resolved ozmetronome

    (@ozmetronome)


    A recent plugin update broke the plugin in IE (and by extension broke the whole site it was on due to IE’s terrible error handling). The error returned was: Object doesn’t support property or method ‘endsWith’ . This is due to IE lacking support for the endsWith string function (used in the plugin on line 12 of svgs-inline.js).

    The workaround I used was to add the following code from MDN to our theme js:

    if (!String.prototype.endsWith) {
      String.prototype.endsWith = function(searchString, position) {
          var subjectString = this.toString();
          if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
            position = subjectString.length;
          }
          position -= searchString.length;
          var lastIndex = subjectString.lastIndexOf(searchString, position);
          return lastIndex !== -1 && lastIndex === position;
      };
    }

    I propose the plugin author either removes the reference to endsWith or just adds the code snippet to the actual plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi @ozmetronome,

    I’ll take a look into this and keep you posted.

    Plugin Author Benbodhi

    (@benbodhi)

    I have added the polyfill to support all these old browsers in version 2.3.6 ??

    Thanks for your support and interest in my plugin.

    Thread Starter ozmetronome

    (@ozmetronome)

    Thanks for the quick fix, mate!

    Plugin Author Benbodhi

    (@benbodhi)

    No problem, thanks for pointing this out!
    I don’t test in IE at all and don’t really support it… but with a workaround so easy, I figured I would include it.

    Thanks again for your support.
    I’d really appreciate it if you took a minute to leave a review for my plugin ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin in advanced mode breaks in IE (all versions)’ is closed to new replies.