machawk1 / tachyon

An experimental Memento browser plugin for Chrome.
1 stars 0 forks source link

onHeadersReceived trigger prevents desired uri redirection when a memento is found #27

Closed machawk1 closed 11 years ago

machawk1 commented 11 years ago

chrome.webRequest.onHeadersReceived.addListener( function(details){
var newURI = mementoStart(details); return {redirectUrl: newURI}; //this doesn't work } }, { urls:["http://_/_", "https://_/_"], types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"] }, ["blocking","responseHeaders"] );

Appears to be not possible from http://developer.chrome.com/extensions/webRequest.html#type-BlockingResponse

machawk1 commented 11 years ago

See http://stackoverflow.com/questions/16928912/url-forwarding-using-chrome-webrequest-after-response-is-received

machawk1 commented 11 years ago

Invalid ticket. This method is no longer used to capture 3xx codes and redirect as of commit 9b140a63a93ed64a61ce0296c74f6d99ef994ba4 . Now, the requests with a 3xx code resulting are put into an array that is later checked. Because the browser and JavaScript cannot prevent the 3xx codes (without completely blocking), the implemented method is more functional.