More Efficient Javascript indexOf query
What exactly do you have in the javascript (json) file?  Can you get the product code from anywhere other than the the path?

Here is what I suggest:


Just include the javascript file.  Don't bother pulling it via JSON.  Doing so just adds overhead you don't need since you are checking this file on every page anyway.
Within the javascript file store the product codes in an array.  

var productCodes = ['code1', 'code2', 'etc...']

Put the test in a separate function.

function pageNeedsProcessing() {
    // add any special rules here to avoid checks when not needed.
    if (location.pathname.indexOf('/product-p/main-product.htm')) {
        return true;
    }

    // do whatever you need to get the product code.  This may require parsing the path.
    var prodCode = ???;

    // if the product code is in array (established in #2) then return true.
    return $.inArray(prodCode, productCodes)  
}

Add your code to be processed.

if (pageNeedsProcessing()) {
      //DO SOMETHING TO THESE SPECIFIC PAGES
}



One caveat here is that doing it exactly like this will introduce some variables into global scope.  But there are ways around that.