Option to only allow HTTP referrer for first-party domain.

My wish is for an option which if enabled would allow the HTTP referrer for first-party domains but remove it when going to a third-party domain.

Example: When going from w​w​w​.​example.com/example/example_URL_1.html to w​w​w​.​e​xample.com/example/example_URL_2.html it will keep the HTTP referrer but when going from w​w​w​.​example.com/example/example_URL_1.html to w​w​w​.​someotherexample.com/example/example_URL_2.html it will strip the HTTP referrer so that the new website don’t know where you come from.