Chrome extension: Block page items before access

后端 未结 3 721
时光说笑
时光说笑 2020-12-02 00:25

I am trying to do block items on a webpage but I want to do that, before they are loaded. So, e.g., I could use

chrome.webRequest.onBeforeRequest.addListener(

3条回答
  •  执念已碎
    2020-12-02 00:41

    I was able to achieve what i was trying to do. The solution does not necessarily need extensions anymore, but to setup a proxy this might be useful. Afterwards, the solution (for the specified problem above) is as follows:

    • Use a chrome extension to use a proxy, in this case, localhost
    • Setup a proxyscript, e.g. using python, to route all traffic (and maybe install certificates, so HTTPs traffic may be analyzed as well)
    • => Man-in-the-middle established, analyze traffic and modify if needed

    Yes, this is not really a solution to the problem of making a chrome extension do this somehow, but it is not possible yet (see https://bugs.chromium.org/p/chromium/issues/detail?id=104058).

    Best regards, mutilis

提交回复
热议问题