fix use of String.endsWith() not compatible with Chromium