Sending a string with a certain path
Your code seems not to be correct. In case you don't have the substring /plug/pluginr/ it would still return true since indexOf returns an integer containing the position of the first ocurrence. If theres no ocurrence of the substring then it returns -1 which is evaluated to true in JavaScript.

You better use this instead;

function isExt(path){
    return path.indexOf("/plug/pluginr/") &gt; -1;
}