Simulating a remote website locally for testing

后端 未结 4 1007
清酒与你
清酒与你 2021-02-06 02:37

I am developing a browser extension. The extension works on external websites we have no control over.

I would like to be able to test the extension. One of the major pr

4条回答
  •  死守一世寂寞
    2021-02-06 02:47

    I don't know if there is an easy way, but there is a way.

    You can set up a local webserver, something like IIS, Apache, or minihttpd.

    Then you can grab the website contents using wget. (It has an option for mirroring). And many browsers have an option for "save whole web page" that will grab everything, like images.

    Ads will most likely come from remote sites, so you may have to manually edit those lines in the HTML to either not reference the actual ad-servers, or set up a mock ad yourself (like a banner image).

    Then you can navigate your browser to http://localhost to visit your local website, assuming port 80 which is the default.

    Hope this helps!

提交回复
热议问题