I am asking this question from an awkward situation. As you may know or not know, Google is blocked in China. A discouraging consequence (at least to me) is that visiting Stack Exchange sites, like Stack Overflow where I used to be very active while I was doing my degree in UK, is very hard. It can take more than 20s to load a page. The problem is that Stack Exchange sites rely on an external JAVA script from
http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
but since Google is blocked, this script can't be accessed. But Firefox would spend considerable time trying to get this script. (Note that the jquery version may change in future, but it is 1.12.4 when this question is asked. Use F12 to check the most up-to-date version.)
In fact, this script can be accessed freely from
https://code.jquery.com/jquery-1.12.4.min.js
So, an ideal solution is to redirect the page under Google domain to Jquery domain.
Is this possible by modifying /etc/hosts
files? At the moment I am simply doing a brutal webpage blocking:
127.0.0.1 ajax.googleapis.com
Although Firefox now will stop trying to load this script so visiting stack exchange sites becomes as fast as normal, many site features are not useable, like voting etc. So the best solution is a redirection.
If immediate redirection is impossible, then I guess I need to download the JAVA script from Jquery to my laptop, then redirect the googleapis page to my localhost. However, I don't know how to set up a localhost, especially where to place my downloaded script.
Can anyone help me out? Very appreciated.