javascript - Modify HTTP request header before sending any request -
javascript - Modify HTTP request header before sending any request -
in chrome extension, modify header before sending http request, using chrome.webrequest
methods. there must way accomplish same functionality without using chrome.webrequest can't seem find any. provide me viable alternatives can check , modify headers before sending requests?
chrome.webrequest.onbeforesendheaders.addlistener(function (req) { var customurl = req.url.substring(0, req.url.indexof('/embed/')); var customrefererobject = { name: 'referer', value: customurl }; $.grep(req.requestheaders, function (headers) { if (headers.name == 'referer') { headers.value = customurl; }
in addition, modifying headers android webview. post might related.
use window.location.href
have @ this: http://ntt.cc/2008/01/21/5-ways-to-redirect-url-with-javascript.html
javascript jquery http http-headers
Comments
Post a Comment