var handler=chrome.webRequest;function onBeforeSendHeaders(a){var b=setting.getFirstMatchedRule({href:a.url},setting.cache.userAgent);if(!b||!(b.userAgent in agents))return{};for(var c=0;c<a.requestHeaders.length;++c)if("User-Agent"==a.requestHeaders[c].name){a.requestHeaders[c].value=agents[b.userAgent];break}return{requestHeaders:a.requestHeaders}}
function registerRequestListener(){if(handler){var a={urls:["<all_urls>"],types:["main_frame","sub_frame","xmlhttprequest"]};try{handler.onBeforeSendHeaders.addListener(onBeforeSendHeaders,a,["requestHeaders","blocking"])}catch(b){console.log("Your browser doesn't support webRequest")}}};
