답변

1

시도 chrome.webRequest. 특히, chrome.webRequest.onBeforeRequest.addListener

당신은 opt_extraInfoSpec 매개 변수의 속성으로 [ "차단"] 문자열을 제공하고, 반환 값으로 당신이 요청에 만들고 싶어 변경을 지정 유형 BlockingResponse의 객체를 제공한다. 또한, POST 요청의 본문을 얻기 위해, opt_extraInfoSpec은 문자열을 포함해야합니다 "requestBody"

같은 것을 보일 것이다 귀하의 코드 : https://developer.chrome.com/extensions/webRequest

편집에

chrome.webRequest.onBeforeRequest.addListener(function(details){ 
// 
    if(details.method == "POST") 
     var new_url = "http://stackoverflow.com/my_new_url"; 

    return {redirectUrl: new_url}; 

}, ({urls: ["http://*/*", "https://*/*"] }), ["blocking", "requestBody"]); 

Dcoumentation을 : 코드 배경 페이지에만 배치 할 수 있습니다.

관련 문제