abhidas17695 / dweb-ext

0 stars 0 forks source link

is webRequest.onCompleted correct ? #16

Closed mitra42 closed 6 years ago

mitra42 commented 6 years ago

is the line webRequest.onCompleted correct, I don’t know this method, but the documentation looks to me like it would fire AFTER the page has loaded, if that page is “dweb,archive.org” then I would have thought we want to intercept BEFORE the page is loaded and stop the page loading

mitra42 commented 6 years ago

I can no longer tell if you are using onCompleted - see #18 , but its still doing the redirect AFTER starting to load the page.

abhidas17695 commented 6 years ago

I am using chrome.webRequest.onBeforeRequest now instead of chrome.webRequest.onCompleted. Effect is the same. The extensions kicks in AFTER the page is loaded. I will see if this can be improved

mitra42 commented 6 years ago

From a brief look, I think onBeforeReuest is correct, but your usage is wrong. I was looking at [https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webRequest/onBeforeRequest] which suggests you need to take certain steps to cancel the load.

abhidas17695 commented 6 years ago

See #21