One use:
On https://example.com/ I add:
<script src="//example.onion/x.js"></script>
x.js contains: alert(
"I notice you can access Tor hidden services. We have"
+ "a hidden service address at example.onion by the way"
);
The only way this would work when you are using SSL on example.com is if you are also using SSL on example.onion.