[smartsyntax] fix: chromium has no "endsWith" method on string, use substr instead