Fix "DataCloneError: DOM Exception 25: An object could not be cloned" in Safari 7

A new version of Safari will arrive soon in OS X 10.9 Mavericks. 
When I try to use extension in Safari Version 7.0 (9537.71), it gives an error:
<pre>DataCloneError: DOM Exception 25: An object could not be cloned</pre>
So this patch will fix the issue in Safari 7, tested on Safari 6 as well