Western powers when establishing diplomatic relations with countries they considered to have underdeveloped legal systems would demand extraterritorial rights.
[1] The British had the widest system of consular courts run by the Foreign Office.
British consular courts could be found in Africa, the Ottoman Empire, Egypt, China, Japan, Korea and Siam.
Britain established a fully fledged court system in China and Japan.
There was a right of appeal to the Judicial Committee of the Privy Council in London from the British consular courts.