var re = new RegExp('([?&](mkt_tok|(g|fb)clid|utm_(source|medium|term|campaign|content|cid|reader|referrer|name))=[^&#]*)', 'ig');

chrome.webRequest.onBeforeRequest.addListener(function(details) {
    var url = details.url;
    var queryStringIndex = url.indexOf('?');
    if (url.indexOf('utm_') > queryStringIndex ||
      url.indexOf('clid') > queryStringIndex ||
      url.indexOf('mkt_tok') > queryStringIndex) {
        var stripped = url.replace(re, '');
        if (stripped.charAt(queryStringIndex) === '&') {
            stripped = stripped.substr(0, queryStringIndex) + '?' +
                stripped.substr(queryStringIndex + 1)
        }
        if (stripped != url) {
            return {redirectUrl: stripped};
        }
    }
},
{urls: ['https://*/*?*', 'http://*/*?*'], types: ['main_frame']}, ['blocking']);

@@ -1,10 +1,402 @@
-var re
+/*%0A * Pattern matching the prefix of at least one stripped query string%0A * parameter. We'll search the query string portion of the URL for this%0A * pattern to determine if there's any stripping work to do.%0A */%0Avar searchPattern = new RegExp('utm_%7Cclid%7Cmkt_tok', 'i');%0A%0A/*%0A * Pattern matching the query string parameters (key=value) that will be%0A * stripped from the final URL.%0A */%0Avar replacePattern
  = n
@@ -671,121 +671,28 @@
 url.
-indexOf('utm_') %3E queryStringIndex %7C%7C%0A      url.indexOf('clid') %3E queryStringIndex %7C%7C%0A      url.indexOf('mkt_tok'
+search(searchPattern
 ) %3E 
@@ -748,16 +748,28 @@
 place(re
+placePattern
 , '');%0A 

Use a regexp for the initial string search