Simplest thing to try first is what Linc already suggested. Open Safari's preferences and click on the Extensions tab. Disable all of them. Turn them on one at a time and test. If the problem returns, that's the extension causing the problem. Disable it again and remove it.